[英]using selenium without browser screen - python windows
i use selenium for instagram appicatin.我在 Instagram appicatin 中使用硒。 i wonder there is any way to run selenium without browser opening in windows?
我想知道有什么方法可以在不打开 Windows 浏览器的情况下运行 selenium? there is some solution in linux like install Xvfb but i don't see any solution for windows!
在 linux 中有一些解决方案,如安装 Xvfb,但我没有看到任何适用于 Windows 的解决方案!
Do you mean that --headless
?你的意思是
--headless
吗?
You can do some operations without opening Chrome if you have chrome-driver.如果你有 chrome-driver,你可以在不打开 Chrome 的情况下进行一些操作。 Here is how to set
headless
:以下是设置
headless
:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chromeoption = Options()
chromeoption.add_argument('--headless')
browser = webdriver.Chrome(options=chromeoption)
# Then it is your work.
browser.get(url="xxx")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.