import requests for i in range(20): r=requests.get("https://cn.bing.com",timeout=30) r.raise_for_status() r.encoding=‘utf-8‘ print(‘状态={}‘.format(r.status_code)) print(r.text) print(‘text属性长度{},content属性长度{}‘.format(len(r.text),len(r.content)))
原文:https://www.cnblogs.com/leisure-yee/p/14128395.html