2 回答
TA貢獻1821條經驗 獲得超5個贊
示例鏈接對我不可用(我無法注冊)
第一的..
什么是“字符串”?
書號?或類別編號?
如果它只是隨機字符串,我認為您應該找到另一種方法。
使用ActionChain怎么樣?或driver.execute_script()?
首先,在我看來,找到字符串的含義(來自 .js 或 .html)更重要。
TA貢獻1829條經驗 獲得超6個贊
我需要幫助來識別下一頁按鈕的 xpath。我的目標是遍歷 Python Selenium 中的頁面。請在此圖片上的 URL 頁面上查看后找到下一頁按鈕的代碼。
檢查后的下一頁按鈕圖片

我嘗試使用 selenium 在 python 中編寫以下代碼以逐頁下載文件。
while True:
scraping() # here I call my function that allows to download the files per page
try:
#Checks if there are more pages with links
next_link = driver.find_element_by_xpath("//*[@title='Page suivante']")
drive.execute_script("arguments[0].scrollIntoView();", next_link)
next_link.click()
#Time sleep
time.sleep(20)
except NoSuchElementException:
pages_rows= False
添加回答
舉報
