当前位置:网站首页>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'))边栏推荐
- 强化学习-学习笔记4 | Actor-Critic
- The relationship between temperature measurement and imaging accuracy of ifd-x micro infrared imager (module)
- The problem of returning the longtext field in MySQL and its solution
- 毫米波雷达人体感应器,智能感知静止存在,人体存在检测应用
- How to realize the Online timer and offline timer in the game
- 打新债在哪里操作开户是更安全可靠的呢
- Which securities company is better and which platform is safer for mobile account opening
- 2022 the latest big company Android interview real problem analysis, Android development will be able to technology
- 618“低调”谢幕,百秋尚美如何携手品牌跨越“不确定时代”?
- Ultrasonic ranging based on FPGA
猜你喜欢

如何在2022年更明智地应用智能合约?

Postman核心功能解析-参数化和测试报告

Tutoriel de téléchargement et d'installation du progiciel fuzor 2020

UWB ultra wideband positioning technology, real-time centimeter level high-precision positioning application, ultra wideband transmission technology

What are the reliable domestic low code development platforms?

Millimeter wave radar human body sensor, intelligent perception of static presence, human presence detection application

关于 Notion-Like 工具的反思和畅想

The basic grammatical structure of C language
![CF: B. almost Ternary Matrix [symétrie + règles de recherche + Construction + I am Construction Waste]](/img/5d/06229ff7cfa144dbcb60ae43d5c435.png)
CF: B. almost Ternary Matrix [symétrie + règles de recherche + Construction + I am Construction Waste]

数据库 逻辑处理功能
随机推荐
JS solution force deduction daily question (12) - 556 Next larger element III (2022-7-3)
Debezium系列之:修改源码支持unix_timestamp() as DEFAULT value
Debezium系列之:IDEA集成词法和语法分析ANTLR,查看debezium支持的ddl、dml等语句
UWB超宽带定位技术,实时厘米级高精度定位应用,超宽带传输技术
Hiengine: comparable to the local cloud native memory database engine
MySql中的longtext字段的返回问题及解决
Oracle date format conversion to_ date,to_ char,to_ Timestamp mutual conversion
MMO项目学习一:预热
Fuzor 2020 software installation package download and installation tutorial
The binary string mode is displayed after the value with the field type of longtext in MySQL is exported
Applet modification style (placeholder, checkbox style)
golang通过指针for...range实现切片中元素的值的更改
Interviewer: what is the difference between redis expiration deletion strategy and memory obsolescence strategy?
手机开户选择哪家券商公司比较好哪家平台更安全
机器学习基础(三)——KNN/朴素贝叶斯/交叉验证/网格搜索
How MySQL queries and modifies JSON data
Windows Oracle open remote connection Windows Server Oracle open remote connection
R语言使用lubridate包处理日期和时间数据实战
Common interview questions in Android, 2022 golden nine silver ten Android factory interview questions hit
flume系列之:拦截器过滤数据