当我执行它时说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行,在runfile execfile(文件名,命名空间)文件" C:/ u / u /d/WinPython-32bit-2.7.6.2/python-2.7.6/Scripts/ox.py" ;,第20行,在home = opener.open('',数据)文件&# 34; C:\ u \ u \ d \ WinPython-32bit-2.7.6.2 \ python-2.7.6 \ lib \ urllib2.py",410行,打开响应= meth(req,response)文件&# 34; C:\ u \ u \ d \ WinPython-32bit-2.7.6.2 \ python-2.7.6 \ lib \ urllib2.py",第523行,在http_response' http',request,响应,代码,消息,hdrs)文件" C:\ u \ u \ d \ WinPython-32bit-2.7.6.2 \ python-2.7.6 \ lib \ urllib2.py",第448行,出错返回self._call_chain(* args)文件" C:\ u \ u \ d \ WinPython-32bit-2.7.6.2 \ python-2.7.6 \ lib \ urllib2.py",第382行,_call_chain result = func(* args)File" C:\ u \ u \ d \ WinPython-32bit-2.7.6.2 \ python-2.7.6 \ lib \ urllib2.py ",第531行,在http_error_default中引发HTTPError(req.get_full_url(),code,msg,hdrs,fp)urllib2.HTTPError:HTTP错误500:内部服务器错误
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
的raw_input(&#34;&#34)