【puppeteer/nodejs】关于新版puppeteer中XPATH的神奇问题
Contents
关于新版puppeteer中XPATH的神奇问题
缘起
项目需要用pupperteer来做apple的RPA。
现在用的新版发现waitForXpath这个方法不能用了。
经过
其实经过调查,在某一个issues 11782中找到了答案。 $x Before:
|
$$ After (note the dot before the xpath):
|
waitForXpath Before:
|
waitForSelector After (note the dot before the xpath):
|
这里直接选取就改成$$,等待出现前面加xpath/.这样就好了。
结语
又可以开心的使用xpath了,特别是那种span包含某text,用的时候比较舒服。