我正在尝试使用URL启动chrome,浏览器启动,之后它什么都不做.
我在1分钟后看到以下错误:
Unable to open browser with url: 'https://www.google.com' (Root cause: org.openqa.selenium.WebDriverException: unknown error: DevToolsActivePort file doesn't exist
  (Driver info: chromedriver=2.39.562718 (9a2698cba08cf5a471a29d30c8b3e12becabb0e9),platform=Windows NT 10.0.15063 x86_64) (WARNING: The server did not provide any stacktrace information)
我的配置:
Chrome:66 ChromeBrowser:2.39.56
PS在Firefox中一切正常
selenium google-chrome webdriver selenium-chromedriver selenium-webdriver
我正在研究一个用于网络搜索的python脚本,并且已经走上了使用Chromedriver作为其中一个软件包的道路.我希望这在没有任何弹出窗口的情况下在后台运行.我在chromedriver上使用'headless'选项,它似乎没有显示浏览器窗口,但是,我仍然看到.exe文件正在运行.看到我正在谈论的截图.截图
这是我用来启动ChromeDriver的代码:
options = webdriver.ChromeOptions()
options.add_experimental_option("excludeSwitches",["ignore-certificate-errors"])
options.add_argument('headless')
options.add_argument('window-size=0x0')
chrome_driver_path = "C:\Python27\Scripts\chromedriver.exe"
我试图做的事情是将选项中的窗口大小改为0x0,但我不确定是什么,因为.exe文件仍然弹出.
有关如何做到这一点的任何想法?
我使用的是Python 2.7 FYI
python selenium selenium-chromedriver selenium-webdriver google-chrome-headless
我正在开发 Apple M1 Pro,并遇到了 Docker 和 chromedriver 的几个问题。
\n所以我想在我的 Docker 容器上使用 selenium chrome headless 运行 RSpec 测试。我的Dockerfile是:
# Start from the official ruby image, then update and install JS & DB\nFROM --platform=linux/amd64 ruby:2.6.6\nRUN apt-get update -qq && apt-get install -y nodejs postgresql-client\n\n# Install Chromedriver\nRUN apt-get update && apt-get install -y unzip && \\\n    CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE` && \\\n    wget -N http://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip -P ~/ && \\\n    unzip ~/chromedriver_linux64.zip -d ~/ && \\\n    rm ~/chromedriver_linux64.zip && \\\n    chown …我需要chromedriver在Windows操作系统上安装。在下面的文章中,它们指定:
https://sites.google.com/a/chromium.org/chromedriver/getting-started
“ ... ChromeDriver希望您将Chrome安装在平台的默认位置...”
但是我不确定默认位置是什么?
在Mac OS上为/usr/local/bin。
这样,我不必显式指定路径或设置系统路径。
如何在Windows OS上实现相同的目标?
selenium google-chrome webdriver selenium-chromedriver selenium-webdriver
我在 Java (1.8) 中使用 Selenium 和 Chromedriver 来执行一些自动网络爬行:
System.setProperty("webdriver.chrome.driver", "chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("someurl.com");
我正在尝试迁移到 Ubuntu 16.04 服务器。在服务器上,我安装了 Ubuntu chromedriver 版本 2.37、chrome 版本 65。根据 chromedriver 文档,这些版本是兼容的。我更改了指定 Ubuntu 中 chromedriver 位置的代码:
System.setProperty("webdriver.chrome.driver", "/usr/lib/local/chromedriver");
在运行我的程序之前,我启动 xvfb:
Xvfb -ac :99 -screen 0 1280x1024x16 &
export DISPLAY=:99
然后执行我的程序:
java -jar myprogram.jar
以下内容打印到控制台:
Starting ChromeDriver 2.37.544315 (730aa6a5fdba159ac9f4c1e8cbc59bf1b5ce12b7) on port 10574
Only local connections are allowed.
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
  (Driver info: chromedriver=2.37.544315 (730aa6a5fdba159ac9f4c1e8cbc59bf1b5ce12b7),platform=Linux 4.4.0-112-generic …