[英]Selenium Edge Driver Silent Mode
I currently have a working python script leveraging Selenium driver for Edge browser.我目前有一个有效的 python 脚本,它利用 Edge 浏览器的 Selenium 驱动程序。 I need this script to run as job but due to security setting SQL Agent and Windows agent cant open the browser to scrape webpage.
我需要此脚本作为作业运行,但由于安全设置 SQL 代理和 Windows 代理无法打开浏览器来抓取网页。 I would need script to run in silent mode without opening the edge browser window.
我需要脚本在不打开边缘浏览器的情况下以静默模式运行 window。
This article seems to be what I need but it is chrome.这篇文章似乎是我需要的,但它是 chrome。
https://stackoverflow.com/questions/62137334/disable-console-output-of-webdriver-using-selenium-in-python
I dont post script because the connections and data in script have connections to a private company intr.net site.我不发布脚本,因为脚本中的连接和数据与私人公司 intr.net 站点有连接。
Use:利用:
var options = new EdgeOptions();
options.AddArguments("--headless");
You can also hide the driver console window:也可以隐藏司机控制台window:
var options = new EdgeOptions();
options.AddArguments("--headless");
options.AddArgument("--no-default-browser-check");
var chromeDriverService = EdgeDriverService.CreateDefaultService();
chromeDriverService.HideCommandPromptWindow = true;
var driver = new EdgeDriver(chromeDriverService, options);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.