admin管理员组文章数量:1391925
I have a list of free https proxies, taken from sslproxies. I am writing a script in Python where I want to switch IP addresses regularly between interactions with websites. I was testing how this works with Selenium Wire and noticed upon testing that my IP address does not actually change after applying a proxy. There are no errors. Below the script I use:
from seleniumwire import webdriver
PROXY = # this is taken from the free proxies, syntax is "http://IP:port"
seleniumwire_options = {
'proxy': {
'http': PROXY,
'https': PROXY,
},
}
driver = webdriver.Chrome(seleniumwire_options = seleniumwire_options)
driver.get("/")
Unfortunately, the above code simply shows my own IP address when I go to the test website whatismyipaddress. Does anyone know how I can 'enable' the proxy? I have also tried doing it by declaring driver.proxy = {'http': PROXY, 'https': PROXY,}.
I have a list of free https proxies, taken from sslproxies.. I am writing a script in Python where I want to switch IP addresses regularly between interactions with websites. I was testing how this works with Selenium Wire and noticed upon testing that my IP address does not actually change after applying a proxy. There are no errors. Below the script I use:
from seleniumwire import webdriver
PROXY = # this is taken from the free proxies, syntax is "http://IP:port"
seleniumwire_options = {
'proxy': {
'http': PROXY,
'https': PROXY,
},
}
driver = webdriver.Chrome(seleniumwire_options = seleniumwire_options)
driver.get("http://whatismyipaddress/")
Unfortunately, the above code simply shows my own IP address when I go to the test website whatismyipaddress. Does anyone know how I can 'enable' the proxy? I have also tried doing it by declaring driver.proxy = {'http': PROXY, 'https': PROXY,}.
Share Improve this question edited Mar 12 at 16:09 toolic 62.3k21 gold badges79 silver badges128 bronze badges asked Mar 12 at 15:37 GizmusGizmus 1 2- for your use you should just use a system-wide proxy here. No need to set any options in Selenium or wire. – browsermator Commented Mar 19 at 18:09
- I understand what you mean, but that would mean I cannot change IP in an automated fashion after every X clicks/interactions on the webdriver, correct? – Gizmus Commented Mar 20 at 19:41
1 Answer
Reset to default 1Free proxies from sites like sslproxies. are often unreliable or dead. Try these fixes:
Check Proxy Status: Test if the proxy is alive using
requests.get("http://httpbin./ip", proxies={"http": PROXY, "https": PROXY})
.Use
verify_ssl=False
: Some free proxies don't support SSL verification.Use Paid/Rotating Proxies: Free proxies often fail. Consider services like Bright Data or ScraperAPI.
本文标签: pythonProxies in Selenium Wire not changing IPStack Overflow
版权声明:本文标题:python - Proxies in Selenium Wire not changing IP? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744743746a2622765.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论