sachin-sankar / swiftshadow

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

Https protocol not working for selenium #25

Closed tvaeyens closed 5 months ago

tvaeyens commented 6 months 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 6 months 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