Skip to content

Instantly share code, notes, and snippets.

@tzvc
Created October 25, 2022 10:19
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 tzvc/75b57a3ba9d8904dff9971c4d2ee6cee to your computer and use it in GitHub Desktop.
Save tzvc/75b57a3ba9d8904dff9971c4d2ee6cee to your computer and use it in GitHub Desktop.

There are a few potential reasons for this error.

One is that the web server is not configured to allow outgoing connections on the port that the web scraper is trying to use (8443).

Another possibility is that the web scraper is trying to connect to a website that is blocking connections from the web server's IP address as part of an anti-scraping protection.

In that case you can try routing your requests through a proxy server.

Here's a example of using a proxy in your code:

import requests

s = requests.Session()

http_proxy = "http://0.0.0.0.0:0000"
https_proxy = "https://0.0.0.0.0:0000"

target = "http://taxsearch.co.grayson.tx.us:8443/"
headers = {} // your headers
proxies = {
    "http": http_proxy,
    "https": https_proxy,
}

r = s.get(url, headers=headers, proxies=proxies)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment