python爬虫之hearder验证缺失
来源:互联网 发布:cad数据恢复 编辑:程序博客网 时间:2024/05/16 01:12
报错:
G:\python27\python.exe D:/编程/PY/test_new.py
Traceback (most recent call last):
File "D:/���/PY/test_new.py", line 9, in <module>
response = urllib2.urlopen(request)
File "G:\python27\lib\urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "G:\python27\lib\urllib2.py", line 400, in open
response = self._open(req, data)
File "G:\python27\lib\urllib2.py", line 418, in _open
'_open', req)
File "G:\python27\lib\urllib2.py", line 378, in _call_chain
result = func(*args)
File "G:\python27\lib\urllib2.py", line 1207, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "G:\python27\lib\urllib2.py", line 1180, in do_open
r = h.getresponse(buffering=True)
File "G:\python27\lib\httplib.py", line 1030, in getresponse
response.begin()
File "G:\python27\lib\httplib.py", line 407, in begin
version, status, reason = self._read_status()
File "G:\python27\lib\httplib.py", line 371, in _read_status
raise BadStatusLine(line)
httplib.BadStatusLine: ''
Process finished with exit code 1
尝试解决方法:
加上一个headers验证试试看
G:\python27\python.exe D:/编程/PY/test_new.py
Traceback (most recent call last):
File "D:/���/PY/test_new.py", line 9, in <module>
response = urllib2.urlopen(request)
File "G:\python27\lib\urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "G:\python27\lib\urllib2.py", line 400, in open
response = self._open(req, data)
File "G:\python27\lib\urllib2.py", line 418, in _open
'_open', req)
File "G:\python27\lib\urllib2.py", line 378, in _call_chain
result = func(*args)
File "G:\python27\lib\urllib2.py", line 1207, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "G:\python27\lib\urllib2.py", line 1180, in do_open
r = h.getresponse(buffering=True)
File "G:\python27\lib\httplib.py", line 1030, in getresponse
response.begin()
File "G:\python27\lib\httplib.py", line 407, in begin
version, status, reason = self._read_status()
File "G:\python27\lib\httplib.py", line 371, in _read_status
raise BadStatusLine(line)
httplib.BadStatusLine: ''
Process finished with exit code 1
尝试解决方法:
加上一个headers验证试试看
0 0
- python爬虫之hearder验证缺失
- Python爬虫之自动登录与验证码识别
- python 爬虫登陆学校教务系统之验证码识别
- Python爬虫之自动登录与验证码识别
- Python爬虫之自动登录与验证码识别
- Python爬虫之自动登录与验证码识别
- python爬虫之验证码识别(浅)
- 爬虫之登陆验证
- python爬虫-->验证码处理
- Python爬虫之分布式爬虫
- 爬虫之验证码问题
- Python之网络爬虫
- Python--之网络爬虫
- python之xpath爬虫
- python之文本爬虫
- python之爬虫框架
- python爬虫之BeautifulSoup
- python爬虫之lxml
- POJ2632——Crashing Robots
- 关于vertical-align的一些心得
- HashMap、HashTable
- java 线程干扰, 内存一致性错误(happens-before)
- super关键字
- python爬虫之hearder验证缺失
- 程序人生之二:十年 IT 生涯感情祭
- Android使用Gradle自动化打包
- Core Animation笔记,基本的使用方法
- 关于火狐开发者工具---个人总结 F12
- Android未开启过的应用收不到广播解决方法
- Fragment与activity怎样传递数据
- hdu5538 House Building--立方体表面积
- android关于selector和shape的使用