07 2021 档案
摘要:学习任务:爬取豆瓣喜剧类热门TOP60的电影并保存在douban.txt文件中。 代码示例: import requests url="https://movie.douban.com/j/new_search_subjects" for i in range(0,60,20):#for循环,每次爬
阅读全文
摘要:一、爬取百度页面代码写入到文件 代码示例: from urllib.request import urlopen #导入urlopen包 url="http://www.baidu.com" #需要爬取网页的网址 resp=urlopen(url) with open("mybaidu.html",
阅读全文