selenium解决异步加载

from time import sleep
from selenium import webdriver


driver = webdriver.Chrome()
# 华为市场的url
huawei_url = "https://appgallery1.huawei.com/#/Apps"
driver.get(huawei_url)
sleep(2)

# 一共下滑十次,下滑一次停顿0.5s
for i in range(10):
driver.execute_script('window.scrollTo(0,document.body.scrollHeight)')
sleep(0.5)

posted @ 2021-06-21 10:09  布都御魂  阅读(568)  评论(0编辑  收藏  举报