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

Function open_jd_search

modules/utils.py:129–145  ·  view source on GitHub ↗
(d, text)

Source from the content-addressed store, hash-verified

127
128
129def open_jd_search(d, text):
130 pkg = _get_jd_pkg(d)
131 logger.info('首先关闭京东App')
132 d.stop_app(pkg)
133 time.sleep(3)
134 logger.info('打开京东App')
135 d.start_app(pkg)
136 logger.info('等待京东首页加载...')
137 if not find_timeout_re(d, '搜索', 10):
138 raise RuntimeError('未能检测到京东首页')
139 d.xpath('//*[@text="搜索"]/../Row').click()
140 logger.info('等待京东搜索页加载...')
141 if not find_timeout_re(d, '搜索', 10):
142 logger.info('未能检测到京东搜索页,退出')
143 logger.info('进入活动')
144 d.input_text(text)
145 d(text='搜索').click()
146
147
148def json2xml(d, hierarchy):

Callers 2

runFunction · 0.90
runFunction · 0.90

Calls 7

_get_jd_pkgFunction · 0.85
find_timeout_reFunction · 0.85
stop_appMethod · 0.80
start_appMethod · 0.80
clickMethod · 0.80
xpathMethod · 0.80
input_textMethod · 0.80

Tested by

no test coverage detected