self.auth = HTTPProxyAuth("te815w", "te815w")
self.proxies = {"http": "112.29.173.117:888"}
self.auth_1 = HTTPProxyAuth("te8152", "te815w")
self.proxies_1 = {"http": "112.29.170.61:888"}
self.auth_list = [(self.auth, self.proxies), (self.auth_1, self.proxies_1)]
我是这样写的 报错,总是说我 ip 没有授权,我一个测试是没有问题的,搞成一个列表报错
enter into list
<requests.auth.HTTPProxyAuth object at 0x7fa4d5e236d8> {'http': '112.29.170.61:888'}
获取内容
<requests.auth.HTTPProxyAuth object at 0x7fa4d5e236d8>
{'http': '112.29.170.61:888'}
ticket=bbf405041bac5120a5547cf069cda1aa
id =21d2ec857faef2cf6df662abe4e41322
841442
http://vip.qimingpian.com/#/detailorg?src=magic&ticket=bbf405041bac5120a5547cf069cda1aa&id=21d2ec857faef2cf6df662abe4e41322<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
<body>
<h1>Unauthorized ...</h1>
<h2>
IP Address: 60.205.219.253:35544<br>
MAC Address: <br>
Server Time: 2018-08-15 19:32:07<br>
Auth Result:
</h2>
</body>
</html>
Traceback (most recent call last):
File "
run.py", line 56, in <module>
run().get_spider()
File "
run.py", line 18, in get_spider
qimingpian().get_id_and_url()
File "/home/shenjianlin/my_project/qimingpian_person/
qimingpian_person.py", line 219, in get_id_and_url
self.get_agency_content(row_column_list[i - 1], row_column_list[i], auth, proxies,user_index)
File "/home/shenjianlin/my_project/qimingpian_person/
qimingpian_person.py", line 246, in get_agency_content
json_data = json.loads(response.text)
File "/usr/lib64/python3.4/json/
__init__.py", line 318, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python3.4/json/
decoder.py", line 343, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python3.4/json/
decoder.py", line 361, in raw_decode
raise ValueError(errmsg("Expecting value", s, err.value)) from None
ValueError: Expecting value: line 1 column 1 (char 0)