标签:== pre response coding python utf-8 int code __name__
#!/usr/bin/python
import requests
if __name__ == "__main__":
url = ‘https://sogou.com‘
response = requests.get(url=url)
page_text = response.text
print(page_text)
with open(‘./sogou.html‘,‘w‘,encoding=‘utf-8‘) as fp:
fp.write(page_text)
print(‘爬取数据结束‘)
标签:== pre response coding python utf-8 int code __name__
原文地址:https://www.cnblogs.com/gerenboke/p/13388973.html