0

当我执行它时,它说 Trackback 最近一次调用最后和第 22 行也是 lib 中的第 410 行,依此类推,在 python 中出现问题。home = opener.open() Traceback 错误(最近一次调用最后一次):文件“”,第 1 行,在文件“C:\u\u\d\WinPython-32bit-2.7.6.2\python-2.7.6\ lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py”,第 540 行,在运行文件 execfile(filename, namespace) 文件“C:/u/u/d/WinPython-32bit-2.7.6.2/python-2.7 .6/Scripts/ox.py”,第 20 行,在 home = opener.open('', data) 文件“C:\u\u\d\WinPython-32bit-2.7.6.2\python-2.7.6\ lib\urllib2.py”,第 410 行,打开响应 = meth(req, response) 文件“C:\u\u\d\WinPython-32bit-2.7.6.2\python-2.7.6\lib\urllib2.py ",第 523 行,在 http_response 'http'、请求、响应、代码、msg、hdrs) 文件 "C:\u\u\d\WinPython-32bit-2.7.

 import urllib
 import urllib2
 import cookielib
 import re
import os
 from random import choice
 cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
opener.addheaders = [
("User-Agent",  "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101       Firefox/26.0"), 
("Cookie", ".SECURITY=232")
 ]
f = 58454700
print "", 
 url = 'http://www.myhost.com/increment'
x = 0
while x < 1000000000:
    f = f + 1
    z = str(f)
    url = 'http://www.myhost.com/Send/SentIncrement'
    data = urllib.urlencode({"Increment": z, "VerificationToken": "Verified"})
    home = opener.open('http://www.myhost.com/Send/SentIncrement', data)
    os.system("cls")
    print f
    print data
    x = x + 1

原始输入(“”)

4

0 回答 0