urllib2 returns 404 for a website which displays fine in browsers

前端 未结 3 850
自闭症患者
自闭症患者 2020-12-16 20:29

I am not able to open one particular url using urllib2. Same approach works well with other websites such as \"http://www.google.com\" but not this site (which also displays

3条回答
  •  青春惊慌失措
    2020-12-16 20:57

    hm... are you sure that URL is valid? try "http://www.google.com" I had similar code and there is no problems with urllib. Or you can use try - except statement to see error's details. And of course MattH's answer is very similar to the truth :)

提交回复
热议问题