0

I have got proxies from leafproxies, and they are giving me something like this. I don't really understand what this is. At the very end, I want to use it in requests.

Here's what they provide.

ipaddress:port:xxx:xxx

I believe that xxx:xxx part is username and password but I am not really sure.

Can anyone guide me, how can I use it with python requests?

Muhammad Zubair
  • 466
  • 5
  • 17

1 Answers1

1

You can try this :

import requests
import os

#Syntax is http://username:password@ipaddress:port
http_proxyf = 'http://xxx:xxx@gPtYMLoPX84.5.maxrainbow.net:8877'
# Copy xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-au-xxxxxxxxxxxxxxxxx-xxxxxxxxxx:xxxxxxxxxxxx 
# and paste at first 
 
os.environ["http_proxy"] = http_proxyf
os.environ["https_proxy"] = http_proxyf

page=requests.get("https://google.com")

To check you can do this:

print(requests.get('https://api64.ipify.org?format=json').json())

This will return the ip address.

imxitiz
  • 3,920
  • 3
  • 9
  • 33