Python + Selenium【无头模式 headless】
所谓浏览器的无头模式headless,就是浏览器在运行时处于后台操作的模式,不会看到浏览器打开,也就不会干扰你手头的工作。对于自动化测试和网络爬虫都有很大的价值。
from selenium.webdriver.firefox.options import Options
from selenium import webdriver
firefox_path = r'geckodriver.exe'
options = Options()
options.headless = True # 设置无头模式为
原创
2021-04-17 18:03:28 ·
855 阅读 ·
0 评论