最简单的python爬虫,爬新浪博客的主页

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

Eclipse直接运行程序:

import requests  # package

req = requests.get(
    'http://www.sina.com.cn/',  # url, as you like
    params={"wd": "find", "rn": "100"},
    headers={'user-agent': 'Mozilla/5.0'}
)
req.encoding = "utf-8"
print(req.text)

效果图如下:

猜你喜欢

转载自blog.csdn.net/zrcshendustudy/article/details/82317941
今日推荐