page_selenium_python.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:spider 作者: luanxiangming 项目源码 文件源码
def repeat_next(self):
        while True:
            try:
                next_button = self.wait.until(
                    EC.element_to_be_clickable(
                        (By.CLASS_NAME, 'float-right'))
                )
                pages = self.driver.find_elements(By.CSS_SELECTOR, '.current.reference.internal')
                for page in pages:
                    ("\n" + page.get_attribute('text'))
                self.click(next_button)
            except NoSuchElementException:
                print("End of page")
                break
            except TimeoutException:
                print("Timeout error...")
                break
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号