在硒javascript上使用用户名和密码身份验证添加代理
当我尝试将代理添加到程序中时,它不适用于用户名和密码身份验证,我只是会出现错误,说无法联系网站,但是当我删除用户名和密码代理登录时,弹出了弹出,当我输入它时,一切都可以使用。
const { Builder } = require('selenium-webdriver')
const chrome = require('selenium-webdriver/chrome')
const PROXY = "username:password@ip:port"
const option = new chrome.Options().addArguments(\--proxy-server=http://${PROXY}`)`
const driver = new Builder().forBrowser('chrome').setChromeOptions(option).build()
driver.get('http://httpbin.org/ip')
.then(() => console.log('DONE'))```
when i try to add proxy to my program it doesnt work with username and password authentication I just get error saying website cant be reached but when I remove username and password proxy login pops up and when I enter it everything works okey.
const { Builder } = require('selenium-webdriver')
const chrome = require('selenium-webdriver/chrome')
const PROXY = "username:password@ip:port"
const option = new chrome.Options().addArguments(\--proxy-server=http://${PROXY}`)`
const driver = new Builder().forBrowser('chrome').setChromeOptions(option).build()
driver.get('http://httpbin.org/ip')
.then(() => console.log('DONE'))```
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论