当前位置:网站首页>Reptile exercises (II)
Reptile exercises (II)
2022-07-05 19:22:00 【InfoQ】
"""
The target site :https://www.1ppt.com/moban/
Climbing requirements :
1、 Turn the page and crawl the source code on this page
2、 And save it locally , Pay attention to coding
"""
'''
1. Analysis website :
https://www.1ppt.com/moban/ first page
https://www.1ppt.com/moban/ppt_moban_2.html The second page
https://www.1ppt.com/moban/ppt_moban_3.html The third page
'''
import urllib.request
start = int(input(" Enter the start page ")) # turn int
end = int(input(" Enter the end page "))
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36'
}
for n in range(start, end + 1):
url = 'https://www.1ppt.com/moban/ppt_moban_{}.html'.format(n)
print(url)
req = urllib.request.Request(url, headers=headers) # Instantiate the request object
response = urllib.request.urlopen(req) # The method to send the request
with open(f' The first {n} page .html', 'a', encoding='gb2312') as f:
f.write(response.read().decode('gb2312'))
边栏推荐
- 不愧是大佬,字节大牛耗时八个月又一力作
- 面试官:Redis中集合数据类型的内部实现方式是什么?
- Can Leica capture the high-end market offered by Huawei for Xiaomi 12s?
- Startup and shutdown of CDB instances
- Is it safe for Guohai Securities to open an account online?
- Reinforcement learning - learning notes 4 | actor critical
- Golang through pointer for Range implements the change of the value of the element in the slice
- After the company went bankrupt, the blackstones came
- 【合集- 行业解决方案】如何搭建高性能的数据加速与数据编排平台
- Realizing deep learning framework from zero -- LSTM from theory to practice [practice]
猜你喜欢
[today in history] July 5: the mother of Google was born; Two Turing Award pioneers born on the same day
Millimeter wave radar human body sensor, intelligent perception of static presence, human presence detection application
强化学习-学习笔记4 | Actor-Critic
Notion 类生产力工具如何选择?Notion 、FlowUs 、Wolai 对比评测
完爆面试官,一线互联网企业高级Android工程师面试题大全
word如何转换成pdf?word转pdf简单的方法分享!
Go语言 | 02 for循环及常用函数的使用
Fuzor 2020軟件安裝包下載及安裝教程
IFD-x 微型红外成像仪(模块)关于温度测量和成像精度的关系
【合集- 行业解决方案】如何搭建高性能的数据加速与数据编排平台
随机推荐
word如何转换成pdf?word转pdf简单的方法分享!
图扑软件数字孪生 | 基于 BIM 技术的可视化管理系统
Microwave radar induction module technology, real-time intelligent detection of human existence, static micro motion and static perception
MySql中的longtext字段的返回问题及解决
Technology sharing | common interface protocol analysis
MMO project learning 1: preheating
Blue sky drawing bed Apple quick instructions
2022最新大厂Android面试真题解析,Android开发必会技术
Get wechat avatar and nickname with uniapp
UWB超宽带定位技术,实时厘米级高精度定位应用,超宽带传输技术
中国银河证券开户安全吗 证券开户
JMeter 常用的几种断言方法,你会了吗?
Startup and shutdown of CDB instances
R语言可视化散点图(scatter plot)图、为图中的部分数据点添加标签、始终显示所有标签,即使它们有太多重叠、ggrepel包来帮忙
5 years of experience, 27 days of Android programmer interview, 2022 programmer advanced classic
全网最全的低代码/无代码平台盘点:简道云、伙伴云、明道云、轻流、速融云、集简云、Treelab、钉钉·宜搭、腾讯云·微搭、智能云·爱速搭、百数云
acm入门day1
Notion 类生产力工具如何选择?Notion 、FlowUs 、Wolai 对比评测
太牛了,看这篇足矣了
Hiengine: comparable to the local cloud native memory database engine