擅长:python、mysql、java
<p>@나민오我需要帮助识别下一页按钮的xpath。我的目标是在Python中循环浏览页面。请在下面找到下一页按钮的代码后,在这个图片的URL页面上检查。你知道吗</p>
<p><a href="https://i.stack.imgur.com/MQltP.png" rel="nofollow noreferrer">next page button picture after inspect</a></p>
<p>我尝试用python和selenium编写以下代码来逐页下载文件。你知道吗</p>
<pre><code>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
</code></pre>