selenium中chrome浏览器怎么设置代理

2025-04-11 06:38:03

1、selenium中chrome浏览器怎么设置代理呢?下面就跟小编一起来看一看具体的操作吧。

selenium中chrome浏览器怎么设置代理

2、工作中遇到需要对项目中使用的selenium设置代理,跟大家分享一下。1.下芙囹买乐载chromeDriver:大家可以通过百度搜索,或者可以通过留言私信小编网址。

selenium中chrome浏览器怎么设置代理

3、2. 将下载好的文件解压,将chromedriver.exe拷贝到chrome根目录,一般是在项目的根目录下。

selenium中chrome浏览器怎么设置代理

4、3.可以使用chromeDriver了,如果把chromedriver拷贝到项目根目录就不需要setProperty了。

selenium中chrome浏览器怎么设置代理

5、但是我是放到了Chrome根目录下,所以要设置驱动路径。 System.setProperty("webdriver.chrome.driver","C:\\Program Files (x86)\\Google\\Chrome\\Application\\chromedriver.exe"); WebDriver driver=new ChromeDriver(); //初始化浏览器

selenium中chrome浏览器怎么设置代理
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢