标签:htm html print odi 记录 .so sts res int
爬虫四步曲
# -指定url
# -发起请求
# -获取响应数据
# -持久化存储
#植入requests模块
import requests
#指定url
url=‘https://www.sogou.com/‘
#发起请求
response=requests.get(url=url)
#获取响应数据
page_text=response.text
#持久化存储
with open(‘sogou.html‘,‘w‘,encoding=‘UTF-8‘) as write_page:
write_page.write(page_text)
print(‘爬虫结束!!!‘)
标签:htm html print odi 记录 .so sts res int
原文地址:https://www.cnblogs.com/sucanji/p/10829086.html