07 2021 档案

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

点击右上角即可分享
微信分享提示