Why does Google Search return HTTP Error 403?

前端 未结 4 485
鱼传尺愫
鱼传尺愫 2020-12-05 11:02

Consider the following Python code:

 30    url = \"http://www.google.com/search?hl=en&safe=off&q=Monkey\"
 31    url_object = urllib.request.urlopen(url);
 32             


        
4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-05 11:40

    If you want to do Google searches "properly" through a programming interface, take a look at Google APIs. Not only are these the official way of searching Google, they are also not likely to change if Google changes their result page layout.

提交回复
热议问题