[英]Headless chrome with Selenium and Java in a Docker container
我正在嘗試使用 Docker 文件在 Docker 容器中運行無頭 Chrome 瀏覽器,但每當它嘗試使用它執行自動化腳本時都會出現崩潰問題。
我嘗試將 Chrome 驅動程序版本更改為 75 和 76,但 Chrome 瀏覽器版本出現問題。
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--headless");
chromeOptions.addArguments("--disable-dev-shm-usage");
chromeOptions.addArguments("--no-sandbox");
chromeOptions.addArguments("--disable-setuid-sandbox");
chromeOptions.addArguments("disable-infobars");
chromeOptions.addArguments("--disable-extensions");
https://hub.docker.com/r/markhobson/maven-chrome/
我使用了來自 Docker Hub 的這張圖片,它現在對我有用。
謝謝你,所有的寶貴意見,他們很有幫助。
使用 chrome 瀏覽器 74 並使用 chromedriver 版本為 74.0.3729.6。 似乎與最新的 chrome 驅動程序版本有些問題
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.