python selenium Chrome Web 驱动程序.如何代理IP/在哪里购买 [英] python selenium Chrome Web Driver. How to Proxy IP/ Where to buy
问题描述
所以我想制作 Selenium 项目,我需要将我的 ip 更改为特定的城市.例如,一个在达拉斯,一个在纽约,一个在洛杉矶.
So i want to make Selenium Project where I need to change my ip to to a specific Cities.For example one in Dallas, One in NewYork, One in Los Angles.
我想知道如何使用 PYTHON 将代理应用于 chrome 网络驱动程序.如果你们可以向我展示一个非常有帮助的示例代码.我见过其他人使用 Firefox 网络驱动程序,但没有看到 chrome 网络驱动程序.
I wanted to know how do I apply a proxy to the chrome web driver using PYTHON. If you guys can show me an example code that would be very helpful. I have seen others with Firefox web driver but not the chrome web Driver.
还有我在哪里可以为每个城市购买专用 IP 代理.我想成为唯一一个使用该 IP 地址的人.
Also where can i buy a Dedicated IP PROXY for each city. I want to be the only one using that ip Address.
推荐答案
from selenium import webdriver
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--proxy-server=1.2.3.4:8080')
driver = webdriver.Chrome(chrome_options=chrome_options)
driver.get("...")
这篇关于python selenium Chrome Web 驱动程序.如何代理IP/在哪里购买的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!