当爬虫页面很多时,不希望总是让浏览器弹出。
参考文章:在爬虫时,如何设置selenium,启动时不弹出浏览器
chrome推出了headless模式代码:
chrome_options= webdriver.ChromeOptions()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--disable-gpu')
driver = webdriver.chrome(chrome_options=chrome_options)
driver.get(url)
网友评论