这将如何工作?我不知道我对硒哈哈有点陌生。
答案 0 :(得分:0)
如果您使用的是chrome驱动程序,则可以通过在浏览器选项中添加无头的方式来做到这一点,例如:
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument('--headless')
with webdriver.Chrome(options=options) as browser:
browser.get(url)
# # Do other stuff
或
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument('--headless')
browser = webdriver.Chrome(options=options)
browser.get(url)
# # do things
browser.close()