import urllib.request
# 在执行过程中,会产生缓存
urllib.request.urlretrieve('http://www.mingxing.com/',filename=r'D:\pypypy\space\18\1.txt')
# 清除缓存
urllib.request.urlcleanup()
print('已清除')
【爬虫】 02 将爬取到的网页写入文件中
猜你喜欢
转载自blog.csdn.net/weixin_38114487/article/details/104707550
今日推荐
周排行