python爬虫爬取网页
程序员文章站
2022-05-03 20:04:33
...
import requests
url="https://blog.csdn.net/weixin_43759352"
try:
r=requests.get(url)
r.raise_for_status()
print( r.encoding)
print( r.text)
except:
print ("failed")