我正在尝试打开此页面https://justjoin.it/warszawa/devops,然后滚动到页面底部。 我试过用这种方法,但不幸的是它不起作用
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait
PATH = "C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(PATH)
driver.get(
"https://justjoin.it/warszawa/devops")
close_popup = WebDriverWait(driver, 10).until(
EC.element_to_be_clickable((By.XPATH, '//*[@id="root"]/div[1]/button'))).click()
time.sleep(3)
print('Time over!')
driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
如果
ActionChains
适合你,试试看。下面分享一个例子。根据您的要求使用。相关问题 更多 >
编程相关推荐