标签:system drive ram code 代理 win edr serve java
System.setProperty("webdriver.chrome.driver", "C:/Program Files (x86)/Google/Chrome/Application/chromedriver.exe");
ChromeOptions chromeOptions = new ChromeOptions();
Map<String, Object> prefs = new HashMap<String, Object>(); prefs.put("profile.managed_default_content_settings.images", 2); chromeOptions.setExperimentalOption("prefs",prefs);
List excludeSwitches=new ArrayList<String>(); excludeSwitches.add("enable-automation"); chromeOptions.setExperimentalOption("excludeSwitches",excludeSwitches);
String ip = "122.236.112.128:4267";
chromeOptions.addArguments("--proxy-server=http://" + ip);
WebDriver driver = new ChromeDriver(chromeOptions); //调整浏览器大小 driver.manage().window().setSize(new Dimension(1300, 800)); ((ChromeDriver) driver).get(url);
Cookie cookie = new Cookie("name","value"); driver.manage().addCookie(cookie);
chromeOptions.addArguments("-headless");
标签:system drive ram code 代理 win edr serve java
原文地址:https://www.cnblogs.com/ushowtime/p/11619333.html