如何watcher一个滑动的项目
来源:8-1 向elasticsearch导入示例数据
兰陵小生
2020-08-01
旧抖音版本中,
self.d.watcher.when(’//*[@text=“滑动查看更多”]’).click()
这个元素再10.6版本中时需要滑动的不能点击的, 我要怎么修改watcher
我用self.d.watcher.when(’//*[@text=“滑动查看更多”]’).swipe(x1, y1, x1, y2)
报错是:
self.d.watcher.when('//*[@text="滑动查看更多"]').swipe(x1, y1, x1, y2)
AttributeError: ‘XPathWatcher’ object has no attribute ‘swipe’
请问老师正确写法是什么
写回答
1回答
-
大壮老师
2020-08-05
尝试
if self.d.watcher.when('//*[@text="滑动查看更多"]'): d.swipe_ext("right") # 手指右滑,4选1 "left", "right", "up", "down"10
相似问题
如何解决模拟登录手机QQ的滑块验证问题
回答 2
如何跳过开始页面
回答 3
我想问一下,滑动后如何获取数据
回答 1
watcher 循环点击按钮的问题
回答 1
关于企业风格的爬虫项目推荐
回答 1