【发布时间】:2019-09-23 08:22:19
【问题描述】:
我想导出所有的文档,所以我需要所有的链接。
如果鼠标不向下滚动,则不会加载所有链接。
需要向下移动一点才能逐渐加载
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
# Configuration information
email = "187069474@qq.com"
password = "Huangbo1019@"
driver = webdriver.Chrome()
index_url = "https://testselenium.quip.com/BCWAOAUkg1v"
driver.get(url=index_url)
driver.find_element_by_xpath('//*[@id="header-nav-collapse"]/ul/li[9]/a').click() # click login
time.sleep(1)
driver.find_element_by_xpath('/html/body/div[2]/div[1]/div[1]/form/div/input').send_keys(email) # input email
driver.find_element_by_xpath('//*[@id="email-submit"]').click()
time.sleep(1)
driver.find_element_by_xpath('/html/body/div/div/form/div/input[2]').send_keys(password) # input password
driver.find_element_by_xpath('/html/body/div/div/form/button').click()
time.sleep(2)
可能需要新策略
【问题讨论】:
-
查看这篇文章以了解如何操作:stackoverflow.com/questions/20986631/…
-
嗨,我测试过,但没有用。
-
我最多有 29 个链接。不是全部 :(