Skip to content

Instantly share code, notes, and snippets.

@kotorkovsciy
Created August 9, 2022 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kotorkovsciy/b8e1c81a5d3bebdfa1bf22d4365017bd to your computer and use it in GitHub Desktop.
Save kotorkovsciy/b8e1c81a5d3bebdfa1bf22d4365017bd to your computer and use it in GitHub Desktop.
A simple example using proxy written using Free-proxy
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