sachin-sankar / swiftshadow

Free IP Proxy rotator library for python
https://sachin-sankar.github.io/swiftshadow/
GNU General Public License v3.0
72 stars 5 forks source link

Https protocol not working for selenium #25

Closed tvaeyens closed 1 week ago

tvaeyens commented 1 month ago

I am trying to get a proxy server IP for selenium:

proxy = Proxy(autoRotate=True, protocol='https').proxy()
print("Proxy response:", proxy)

--> Proxy response: {'https': ''}

options = webdriver.ChromeOptions()
service = Service(executable_path=chrome_driver_path)
options.add_argument('--proxy-server=%s' % ip)
driver = webdriver.Chrome(service=service, options=options)

When I set the protocol to http, I get an IP in the dictionary. Any ideas what I am doing wrong here?

Thanks!

sachin-sankar commented 1 month ago

The return type is in dict so that you can use it seamlessly with the python requests module. For selenium try https://stackoverflow.com/a/40628176