【Python5天】第四天爬虫入门

阅读 62

2022-05-01

import urllib.request

url = "http://www.douban.com"
headers = {
    "User-Agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Mobile Safari/537.36"
}
req = urllib.request.Request(url=url,headers=headers)
response = urllib.request.urlopen(req)
print(response.read().decode("utf-8"))

#今天各种懵逼,418,200,404,爬虫这我好懵逼啊!

m-e-m-o

易企秀(一起秀)

精彩评论(0)

0 0 举报