juhacz
juhacz

Reputation: 1

Webscraping issue with cloudscraper and proxies

I have problem with usage proxies servers with cloudscraper.

Simple program:

proxy_list = {"http": "http://username:[email protected]:port"}
scraper = cloudscraper.create_scraper()
print(scraper.get("https://api.ipify.org/", proxies=proxy_list))
exit()

This simple program always showing my IP address not used proxy server. Why? I try multiple (working) proxy servers, no errors when running, and always not working. Any suggestions?

Upvotes: 0

Views: 2630

Answers (2)

M. Serseg
M. Serseg

Reputation: 123

You have to set proxy for both http and https

proxy_list = {"http": "http://username:[email protected]:port", "https": "http://username:[email protected]:port"}

Upvotes: 0

juhacz
juhacz

Reputation: 1

I change:

proxy_list = {"http": "http://username:[email protected]:port"}
to
proxy_list = {"https": "http://username:[email protected]:port"}

and all now working fine, but I don know why.

Upvotes: 0

Related Questions