2
我正在爲使用硒蟒蛇並面臨問題的linkedin撰寫腳本。我想滾動對話框的窗口,但我的腳本開始在後面的滾動窗口。使用硒蟒蛇的滾動窗口
driver=webdriver.Chrome()
driver.get('https://www.linkedin.com/uas/login?goback=&trk=hb_signin')
driver.find_element_by_name('session_key').send_keys(email)
time.sleep(2)
driver.find_element_by_id('session_password-login').send_keys(password,Keys.RETURN)
time.sleep(7)
driver.get('https://www.linkedin.com/in/rickblack/skills/(ACoAAAC4aQcBoD2OHCmDN1Fe7n2dMtoVYkWTz4o,27)/')
driver.switch_to.window(driver.window_handles[-1])
for o in range(0,5):
driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
time.sleep(1)
感謝您的幫助 – Naeem