史上最简单的python爬虫程序

版权声明:本文为博主原创文章,未经博主允许也可以得转载。 https://blog.csdn.net/zrcshendustudy/article/details/82317045

适用于python版本3.4以上的:

import urllib.request

print(urllib.request.urlopen("https://www.baidu.com").read())

使用于python版本2.0以上的:

import urllib2

print(urllib.urlopen("http://www.baidu.com").read())


 

猜你喜欢

转载自blog.csdn.net/zrcshendustudy/article/details/82317045