python 爬虫入门

今天学习爬虫,成功了,开心的像个小孩

环境 python3.5 pycharm



import urllib.request

url = "http://www.zhihu.com"
response = urllib.request.urlopen(url)
html = response.read()
data = html.decode('utf-8', 'ignore')
print(data)

猜你喜欢

转载自blog.csdn.net/qq_33291307/article/details/80141434