Python's urllib2 don't work on some sites

Posted by Binny V A on Stack Overflow See other posts from Stack Overflow or by Binny V A
Published on 2010-04-03T18:44:24Z Indexed on 2010/04/03 18:53 UTC
Read the original article Hit count: 267

Filed under:
|
|

I found that you can't read from some sites using Python's urllib2(or urllib). An example...

urllib2.urlopen("http://www.dafont.com/").read()
# Returns ''

These sites works when you visit the site. I can even scrap them using PHP(didn't try other languages). I have seen other sites with the same issue - but can't remember the URL at the moment.

My questions are...

  1. What is the cause of this issue?
  2. Any workaround for this issue?

© Stack Overflow or respective owner

Related posts about python

Related posts about urllib