python的selenium爬取过程不出浏览器

只需要在代码前面加上下面的代码即可:

option = webdriver.FirefoxOptions()#设置无头
option.set_headless()
driver = webdriver.Firefox(firefox_options=option)

非常简单大家试一下吧!

猜你喜欢

转载自blog.csdn.net/liaoningxinmin/article/details/82594179