Python Forum
Proxy Issues with REQUESTS_HTML
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Proxy Issues with REQUESTS_HTML
#1
Hi

I am new to Python and am looking at scraping some data from a website. I sit behind a firewall and cannot make a connection to the outside world from my script. Internal websites work fine.

At the most very basic my code looks like this :

from requests_html import HTML, HTMLSession

session = HTMLSession(browser_args=["--proxy-server=192.168.56.210:8080"])
r = session.get('http://www.yyyyyy.govt.nz/')
#r = session.get('http://uno.xxxxxx.co.nz/') -- internal site that works

print(r.html)


I currently am getting an error : requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))

The proxy does not need a username/password

Can someone please confirm my syntax is correct and the best way to use a proxy with requests_html. I can then ask with confidence whether it is being blocked by the firewall.

Thanks

Andrew
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020