I want to use a proxy in my code.

What I'm trying to do is open a list of proxies from a .txt and load them as the proxy. If I just can get the code to use proxy, I'm sure I can figure out the rest. Here is my main code:

filehandle = urllib.urlopen(address)

for lines in filehandle.readlines(1):
    print (lines)

filehandle.close()

Also, how come this does not count towards page views? I have a simple web counter here: http://pedrumgolriz.com/nonproxy.html

When I run the script, it does not give me any views. And no, the counter is not based on unique page views. I will work on that once I get the proxy part down.

ok I understand why that doesnt work, it obviously only reads the source code of the page. So the question now is, in addition to the whole proxy problem, how do I view a webpage in python!? ..without opening up a browser

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.