学习编程,第一句都是“Hello world”。
那么,既然学习爬虫,那么记录下第一条代码:
import requests url='http://www.colinjiang.com/dh/' resp = requests.get(url) print(resp.content) #保存网页 f = open('colin.html','w+',encoding='utf-8') f.write(resp.text) f.close()
学习编程,第一句都是“Hello world”。
那么,既然学习爬虫,那么记录下第一条代码:
import requests url='http://www.colinjiang.com/dh/' resp = requests.get(url) print(resp.content) #保存网页 f = open('colin.html','w+',encoding='utf-8') f.write(resp.text) f.close()