最简单的爬虫代码(Python3)

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/maozexijr/article/details/80676026
今日推荐