![]() |
|
[Python] Opening a url with a proxy - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Python] Opening a url with a proxy (/showthread.php?tid=5977930) |
Opening a url with a proxy - pms - Jun 8, 2019 first of, I'm fairly new to python so dont judge me please. Questions - [+] I already know how to open a url/link with python. But i want the link to run a proxy automaticly once i run the script. How? [+] Is it even possible? Code #! /usr/bin/env pythonRE: Opening a url with a proxy - Lynx - Jun 9, 2019 You can use the 'requests' library with the proxy argument. Code import requestsRE: Opening a url with a proxy - pms - Jun 9, 2019 (Jun 9, 2019 01:14 AM)Lynx Wrote: You can use the 'requests' library with the proxy argument. I would have to change the webbrowser.open to requests.get('http://google.com', proxies=proxies). right? RE: Opening a url with a proxy - Lynx - Jun 9, 2019 (Jun 9, 2019 01:20 AM)pms Wrote: I would have to change the webbrowser.open to requests.get('http://google.com', proxies=proxies). right? Yes. Also, if you want to get the response, you can use this: r = requests.get('http://google.com', proxies=proxies) print(r.text) RE: Opening a url with a proxy - pms - Jun 9, 2019 (Jun 9, 2019 01:25 AM)Lynx Wrote: Yes. Also, if you want to get the response, you can use this: Got it, thank you for the help ! |