Created
August 9, 2022 16:12
-
-
Save kotorkovsciy/b8e1c81a5d3bebdfa1bf22d4365017bd to your computer and use it in GitHub Desktop.
A simple example using proxy written using Free-proxy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from fp.fp import FreeProxy | |
from fake_useragent import UserAgent | |
proxy = FreeProxy(https=False, anonym=True).get() | |
User_Agent = UserAgent() | |
headers = { | |
"User-Agent": User_Agent.random | |
} | |
proxies = { | |
'http': proxy | |
} | |
url = 'http://ipinfo.io/json' | |
data = requests.get(url, headers=headers, proxies=proxies) | |
print(data.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment