MCPcopy
hub / github.com/MonsterNone/tmall-miao / find_timeout_xpath

Function find_timeout_xpath

modules/utils.py:55–63  ·  view source on GitHub ↗
(d, xpath_str, timeout)

Source from the content-addressed store, hash-verified

53
54# 通过xpath超时寻找,找到返回true,找不到返回false
55def find_timeout_xpath(d, xpath_str, timeout):
56 flag = False
57 for i in range(timeout):
58 if not d.xpath_exists(xpath_str):
59 time.sleep(0.8)
60 continue
61 flag = True
62 break
63 return flag
64
65
66# 通过正则寻找,找到返回[result],找不到返回[]

Callers 1

do_search_task_energyFunction · 0.90

Calls 1

xpath_existsMethod · 0.80

Tested by

no test coverage detected