我試圖從這site刮內容。要進入下一頁,我嘗試點擊頁面底部的下一頁按鈕。我也嘗試通過下拉列表更改的頁面,但我得到的錯誤作爲Element not visible
元素不可見硒蟒
我甚至使用actionchain通過下一個頁面,以獲得試過:
act = ActionChains(self.driver)
select_text=act.move_to_element(self.driver.find_element_by_xpath("//div[@id='pagination-group']/select[@id='pagination-select']"))
select_text.click().perform()
time.sleep(4)
option_text = self.driver.find_elements_by_xpath("//div[@id='pagination-group']/select[@id='pagination-select']/option")
for o in option_text:
if o.text in ('2','3','4','5','6'):
o.click()
但我再次得到錯誤的line 47, in parse if o.text in ('2','3','4','5','6'):' StaleElementReferenceException: Message: Element not found in the cache - perhaps the page has changed since it was looked up