简体   繁体   English

在没有浏览器屏幕的情况下使用 selenium - python windows

[英]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.

相关问题 如何在 Windows 上使用 Selenium 和 Python 启动 Brave 浏览器 - How to initiate Brave browser using Selenium and Python on Windows Python:在浏览器上打开本地 html 文件,而不使用 Webbrowser 或 Selenium - Python : Opening local html file on browser without using Webbrowser or Selenium Selenium:退出Python脚本而不关闭浏览器 - Selenium: Quit Python script without closing browser 蟒蛇硒| 无需重启浏览器即可更新代理 - Python Selenium | Update Proxy Without Restarting Browser 获取当前浏览器 URL 没有 Selenium Python - Get Current Browser URL without Selenium Python Selenium Python 最大化 Chrome 浏览器窗口大小以使其适合使用屏幕大小 - Selenium Python maximize Chrome browser window size to make it fit with using screen size 在不使用任何浏览器的情况下使用 Selenium - Using Selenium without using any browser 当浏览器中有多个具有使用python硒的滚动条的窗口时,如何向下滚动 - How do I scroll down when there are multiple windows within a browser that has scroll bars using python selenium 弃用警告:在 Python Selenium 和 Windows 上使用 Brave 浏览器时使用选项而不是 chrome_options 错误 - DeprecationWarning: use options instead of chrome_options error using Brave Browser With Python Selenium and Chromedriver on Windows {Python, Selenium} 如何检测我已经在使用的浏览器窗口并在所述浏览器窗口中创建一个新选项卡? - {Python, Selenium} How can I detect browser windows that I'm already using and create a new tab inside said browser window?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM