xpath定位无法定位标签下一行文本
回答
收藏

xpath定位无法定位标签下一行文本

t
tyrion
2023-06-09 13:47·浏览量:1870
t
tyrion
发布于 2023-06-09 13:471870浏览

同样一段xpath://div[@class="resume-section geek-expect-wrap"]/div[@class="section-content"]/div[@class="join-text-wrap"]//text()[2]


在影刀上无法使



在chrome上可以正确用xpath定位出来


影刀报错:

1:18
Traceback (most recent call last):
File "C:\Program Files (x86)\ShadowBot\shadowbot-5.11.25\python\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Program Files (x86)\ShadowBot\shadowbot-5.11.25\python\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Program Files (x86)\ShadowBot\shadowbot-5.11.25\python\lib\site-packages\xbot_interpreter.py", line 87, in <module>
main()
File "C:\Program Files (x86)\ShadowBot\shadowbot-5.11.25\python\lib\site-packages\xbot_interpreter.py", line 47, in main
try:
File "C:\Users\baishirencai\AppData\Local\ShadowBot\users\73280677044563969\apps\8e40f558-8f47-48f5-8754-b9c787895965\xbot_robot\process35.py", line 19, in main
父元素 = xbot_visual.web.element.get_element(browser=package.variables['web_page'], select_type="xpath_selector", selector=None, css_selector="", xpath_selector="//div[@class=\"resume-section geek-expect-wrap\"]/div[@class=\"section-content\"]/div[@class=\"join-text-wrap\"]//text()[2]", is_related_parent=False, parent="", timeout="3", _block=("子流程1", 2, "获取元素对象(web)"))
File "<string>", line 89, in wrapper
File "<string>", line 84, in wrapper
File "<string>", line 408, in get_element
File "<string>", line 573, in find_by_xpath
File "<string>", line 519, in find_all_by_xpath
File "<string>", line 510, in find_all_by_xpath
File "<string>", line 42, in _invoke
File "<string>", line 764, in _invoke
File "<string>", line 115, in execute
File "<string>", line 88, in execute
xbot.errors.UIAError: TypeError: element.getAttribute is not a function
at Object.uidFromElement (eval at invoke (chrome-extension://nhkjnlcggomjhckdeamipedlomphkepc/content.static.js:4:33), <anonymous>:221:31)
at eval (eval at invoke (chrome-extension://nhkjnlcggomjhckdeamipedlomphkepc/content.static.js:4:33), <anonymous>:2049:51)
at Array.map (<anonymous>)
at queryXPathSelectorAll (eval at invoke (chrome-extension://nhkjnlcggomjhckdeamipedlomphkepc/content.static.js:4:33), <anonymous>:2049:33)
at Object.invoke (eval at invoke (chrome-extension://nhkjnlcggomjhckdeamipedlomphkepc/content.static.js:4:33), <anonymous>:3734:39)
at invoke (chrome-extension://nhkjnlcggomjhckdeamipedlomphkepc/content.static.js:10:38)
at <anonymous>:1:18


我怀疑是影刀的xpath不支持 text() 语法

收藏2
全部回答1
最新
发布回答
回答