Can't get the real contents form page in internet as the tag "no-chche"

I V wrongbad at gmail.com
Thu Mar 23 05:17:12 CET 2006


dongdong wrote:
> using web browser can get page's content formally, but when use
> urllib2.open("http://tech.163.com/2004w11/12732/2004w11_1100059465339.html").read()
>
> the result is
>
> <html><head><META HTTP-EQUIV=REFRESH
> CONTENT="0;URL=http://tech.163.com/04/1110/12/14QUR2BR0009159H.html">

This line here instructs the browser to go to
http://tech.163.com/04/1110/12/14QUR2BR0009159H.html . If you try
loading that with urllib2, do you get the right content?

If the people behind that web page new how to use the web, they
wouldn't use the META HTTP-EQUIV hack,  and instead would have
instructed their web server to return a 300 redirect response, which
would have allowed urllib2 to follow the redirect and get the right
content automatically. If you have any influence with them, you could
try and persuade them to set up their web server properly.




More information about the Python-list mailing list