下面的代碼打開一個新的空白視窗有什么解決辦法嗎?坦克!
Chrome 版本 90.0.4430.72(官方構建)(32 位)ChromeDriver 90.0.4430.24
并嘗試使用 Chrome 版本 100.0.4896.127
\命令列代碼:C:\Program Files (x86)\Google\Chrome\Application>chrome.exe --remote-debugging-port=9222 -user-data-dir="D:\Programing\Programing App\chromedriver_win32\鉻資料"
\java代碼:
包硒1;
匯入 org.openqa.selenium.chrome.ChromeDriver;匯入 org.openqa.selenium.chrome.ChromeOptions;
公共類 Chromeoptiontest {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver",
"D:\\Programing\\Programing App\\oldChromeDriver\\chromedriver.exe");
ChromeOptions option = new ChromeOptions();
option.setExperimentalOption("debuggerAddress", "127.0.0.1:9222");
ChromeDriver driver = new ChromeDriver(option);
}
}
uj5u.com熱心網友回復:
官方不支持。
但是,有一些作業代碼聲稱支持這一點:
https://web.archive.org/web/20171214043703/http://tarunlalwani.com/post/reusing-existing-browser-session-selenium-java/。
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/482295.html
標籤:硒
下一篇:嘗試使用硒刮標題
