views:

48

answers:

1

Hey ppl...

My program isn't running properly as should be...

I'm getting only the error message (except part) of the urlopen with the proxy... why? At least, one of the proxy was tested and work correctly...

please, some one take a look on the code here: http://pastebin.com/cBfv5H8J

edit:

the code doesn't work on the first try part, this one

        try:
            h = urllib.urlopen(website, proxies = {'http': proxylist})
            break

and always return me the

        except:
            print '['+time.strftime('%Y/%m/%d %H:%M:%S')+'] '+'ERROR. Trying again... (%s)' % proxy
            time.sleep(1)
A: 

At least one error:

h = urllib.urlopen(website, proxies = {'http': proxylist})

Should be

h = urllib.urlopen(website, proxies = {'http': proxy})
MattH
that's odd... how can python work this way? How does it do to use the proxies that are on the 'proxylist' with the simple 'proxy' ? How does it know?
Shady
I guess you didn't write that code in the pastebin. There is a `for proxy in proxylist:` It is calling `urllib.urlopen` with each item in the list `proxylist` in turn. The whole thing looks a bit odd to be honest. What are you trying to achieve?
MattH
The program is to work like this: check a website until he change, and then play the alarm... but I need proxys to check more often and not be banned... get it? and even the 'proxy' or the 'proxylist' get me the same result =(
Shady