当前位置:网站首页>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'))边栏推荐
- After the company went bankrupt, the blackstones came
- R language uses lubridate package to process date and time data
- Notion 类生产力工具如何选择?Notion 、FlowUs 、Wolai 对比评测
- How to quickly advance automated testing? Listen to the personal feelings of the three bat test engineers
- JS solution force deduction daily question (12) - 556 Next larger element III (2022-7-3)
- Reinforcement learning - learning notes 4 | actor critical
- 国海证券在网上开户安全吗?
- Postman核心功能解析-参数化和测试报告
- The binary string mode is displayed after the value with the field type of longtext in MySQL is exported
- Windows Oracle open remote connection Windows Server Oracle open remote connection
猜你喜欢
![[today in history] July 5: the mother of Google was born; Two Turing Award pioneers born on the same day](/img/7d/7a01c8c6923077d6c201bf1ae02c8c.png)
[today in history] July 5: the mother of Google was born; Two Turing Award pioneers born on the same day

acm入门day1
![[performance test] jmeter+grafana+influxdb deployment practice](/img/32/f07792734d040829398a90a2040146.png)
[performance test] jmeter+grafana+influxdb deployment practice

毫米波雷达人体感应器,智能感知静止存在,人体存在检测应用

100million single men and women supported an IPO with a valuation of 13billion

Oracle fault handling: ora-10873:file * needs to be either taken out of backup or media recovered

How to convert word into PDF? Word to PDF simple way to share!
Mysql如何对json数据进行查询及修改

强化学习-学习笔记4 | Actor-Critic

What are the reliable domestic low code development platforms?
随机推荐
JMeter 常用的几种断言方法,你会了吗?
[performance test] jmeter+grafana+influxdb deployment practice
PG basics -- Logical Structure Management (user and permission management)
Get wechat avatar and nickname with uniapp
Fundamentals of shell programming (Part 8: branch statements -case in)
泰山OFFICE技术讲座:由行的布局高度,谈绘制高度的高度溢出、高度缩水(全网首发)
android中常见的面试题,2022金九银十Android大厂面试题来袭
Fuzor 2020軟件安裝包下載及安裝教程
面试官:Redis中集合数据类型的内部实现方式是什么?
XaaS 陷阱:万物皆服务(可能)并不是IT真正需要的东西
测试的核心价值到底是什么?
2022 the latest big company Android interview real problem analysis, Android development will be able to technology
Debezium系列之:修改源码支持unix_timestamp() as DEFAULT value
JAD的安装、配置及集成IDEA
数据库 逻辑处理功能
Debezium系列之:修改源码支持drop foreign key if exists fk
Android面试,android音视频开发
Is it safe for Guohai Securities to open an account online?
全网最全的低代码/无代码平台盘点:简道云、伙伴云、明道云、轻流、速融云、集简云、Treelab、钉钉·宜搭、腾讯云·微搭、智能云·爱速搭、百数云
Vagrant2.2.6 supports virtualbox6.1