def swip_action(self, flage, up_down, msg):
"""
:param flage: 滑屏找对应的元素
:param up_down: 屏幕是向上滑还是向下滑
:param msg:滑屏使某个元素不在当前页面里面
:return:
"""
time.sleep(2)
try:
while 1:
l1 = driver_base.get_window_size()
x11 = l1['width'] * 0.5
y11 = l1['height'] * 0.50
y12 = l1['height'] * 0.35
if up_down == "down":
driver_base.swipe(x11, y11, x11, y12, 1000)
if up_down == "up":
driver_base.swipe(x11, y12, x11, y11, 1000)
source = driver_base.page_source
if msg == "消失":
if flage not in source:
break
else:
if flage in source:
python之三上下滑动鼠标
最新推荐文章于 2023-12-15 15:12:41 发布