from selenium.webdriver.firefox.options import Options
options = Options()
options.headless = True
driver = webdriver.Firefox(firefox_options=options, executable_path=ex_path)
selenium 使用 firefox 在爬取数据时不弹出浏览器的代码
如上,options 里面 headless设置为true就行
from selenium.webdriver.firefox.options import Options
options = Options()
options.headless = True
driver = webdriver.Firefox(firefox_options=options, executable_path=ex_path)
selenium 使用 firefox 在爬取数据时不弹出浏览器的代码
如上,options 里面 headless设置为true就行