[Python] Proxychains and urllib2 - Python

Discussão em 'Python' iniciado por Stack, Agosto 5, 2025.

  1. Stack

    Stack Membro Participativo

    I wrote the following Python script which uses urllib2:

    def http_response(url):
    try:
    connection = urllib2.urlopen(url)
    return connection.getcode()
    connection.close()
    except urllib2.HTTPError, e:
    return e.getcode()


    It works well, but if I want to run it through tor, using Proxychains I get a Connection Refused error. My question is, is there a way to do the same things in a way that works also with proxychains, without making the Python script connect to the socks proxy itself?

    Continue reading...

Compartilhe esta Página