- 论坛徽章:
- 0
|
回复 #2 asnama 的帖子
找到原因了,还是和proxy相关 ,个性的的urllib实现:
The urlopen() function works transparently with proxies which do not require
authentication. In a Unix or Windows
environment, set the http_proxy, ftp_proxy or gopher_proxy environment variables to a
URL that identifies the proxy server
before starting the Python interpreter. For example (the "%" is the command prompt):
% http_proxy="http://www.someproxy.com:3128"
% export http_proxy
% python
...
In a Windows environment, if no proxy environment variables are set, proxy settings
are obtained from the registry's
Internet Settings section.
简单说,windows下urllib默认会悄悄的把IE设定的proxy作为自己的proxy,
而我这段程序的目的正好是写一个proxy,所以只能死循环了
用urlopen得不到数据是因为它去找代理了,而设置的代理没有运行,且在本地,怪不得我抓包根本
抓不到向外发的包... |
|