用xpath选择器获取元素对象,但是匹配到多个元素无法定位。如何处理
回答
收藏

用xpath选择器获取元素对象,但是匹配到多个元素无法定位。如何处理

1
11111g
2023-09-20 13:58·浏览量:380
1
11111g
发布于 2023-09-20 13:58380浏览

匹配到多个元素, 无法唯一定位

Traceback (most recent call last):

 File "D:\ShadowBot\shadowbot-5.13.33\python\lib\runpy.py", line 193, in _run_module_as_main

   "__main__", mod_spec)

 File "D:\ShadowBot\shadowbot-5.13.33\python\lib\runpy.py", line 85, in _run_code

   exec(code, run_globals)

 File "D:\ShadowBot\shadowbot-5.13.33\python\lib\site-packages\xbot_interpreter.py", line 94, in <module>

   main()

 File "D:\ShadowBot\shadowbot-5.13.33\python\lib\site-packages\xbot_interpreter.py", line 53, in main

   try:

 File "C:\Users\ofz\AppData\Local\ShadowBot\users\6beb02d0-ddfd-45da-9d1c-6a2cad8ca00c\apps\99c1d8d8-a034-4f17-b1e9-4643cb7fe78c\xbot_robot\main.py", line 45, in main

   支付买家数元素对象 = xbot_visual.web.element.get_element(browser=web_page2, select_type="xpath_selector", selector=None, css_selector="", xpath_selector="//*[@id=\"central\"]/tbody/tr/td[5]/div[1]", is_related_parent=False, parent=None, timeout="20", _block=("main", 28, "获取元素对象(web)"))

 File "<string>", line 89, in wrapper

 File "<string>", line 84, in wrapper

 File "<string>", line 417, in get_element

 File "<string>", line 579, in find_by_xpath

xbot.errors.UIAError: Message:匹配到多个元素, 无法唯一定位

Code:1


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