开发者

Errno socket error in python

开发者 https://www.devze.com 2022-12-31 21:41 出处:网络
i wrote this code : import random import sys import urllib openfile = open(sys.argv[1]).readlines() c = random.choice(openfile)

i wrote this code :

import random
import sys
import urllib
openfile = open(sys.argv[1]).readlines()
c = random.choice(openfile)
i = 0
while i < 5:
 i=i+1
 c = random.choice(openfile)
 proxies = {'http': c}
 opener = urllib.FancyURLopener(proxies).open("http://whatismyip.com.au/").read()

::: I put 3 proxy in a txt file . :

http://211.161.159.74:8080
http://119.70.40.101:8080
http://124.42.10.119:8080

but when execute it i get this error :

开发者_Go百科
IOError: [Errno socket error] (10054, 'Connection reset by peer')

what am i going to do ? please help me .


The first proxy you list is giving my telnet an ECONNRESET too. What makes you think these are valid proxies? Incidentally, if you are trying to find out their DNS names, they don't have any.

$ dig -x  211.161.159.74 
;; connection timed out; no servers could be reached
0

精彩评论

暂无评论...
验证码 换一张
取 消