'How to use GB proxies with python requests? [Python 3]
I have been facing a problem with my code lately in which I want to enable the usage of GB proxies within the software, to have a better notion of what type of GB proxies, I have been testing with Leaf Proxies, and still when trying to use the proxies in the following format:
proxy = {
'http': 'http://' + ip_format_of_leaf_proxies,
'https': 'http://' + ip_format_of_leaf_proxies
}
it does not work and throws the following exception message:
Failed to parse: http://us-fast.resdleafproxies.com:0000:xxxxxxxxxxxxxxxxxxxxxx+AAAAAAAb:xxxxxxxxxx
Then I read an article which said that GB proxies are commonly known as SOCKS proxy, if not quite sure if Leaf proxies enter into that 'category' of proxies but still tried with installing socks dependency as stablished in requests official docs like this:
python3 -m pip install requests[socks]
After installing it, I tried with different formats in the dictionary of proxies such as:
proxy = {
'http': 'socks://' + ip_format_of_leaf_proxies,
'https': 'socks://' + ip_format_of_leaf_proxies
}
or just like this:
proxy = {
'http': ip_format_of_leaf_proxies,
'https': ip_format_of_leaf_proxies
}
but still got the same error
Question: How can I allow my python script to make a request to any website with this proxy format?
NOTE: overall proxy format of leaf proxies: us-fast.resdleafproxies.com:0000:xxxxxxxxxxxxxxxxxxxxxx+AAAAAAAb:xxxxxxxxxx
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
