web端滑动页面查找元素

def scroll_find_element(text):
scroll = 0
while scroll<7000:
try:
# driver.find_element_by_partial_link_text(text)
driver.find_element_by_css_selector(text)
except:
scroll += 100
js = "document.documentElement.scrollTop={0}".format(scroll)
driver.execute_script(js)
else:
print("find out text_element")
break
else:
driver.execute_script("document.documentElement.scrollTop=0")
print("find not out text_element")

 

web端滑动页面查找元素

上一篇:Java 8之base64


下一篇:HTTPS的GET、POST、PUT、DELETE请求