import requests for i in range(1,21): r = requests.get("https://www.google.cn/") r.raise_for_status() r.encoding=\'utf-8\' print(r.status_code) print(r.text) len1=len(r.text) len2=len(r.content) print(\'text()属性所返回的长度{}\'.format(len1)) print(\'content()属性所返回的长度{}\'.format(len2))