当前位置:网站首页>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'))边栏推荐
- Talking about fake demand from takeout order
- 在线协作产品哪家强?微软 Loop 、Notion、FlowUs
- Debezium系列之:修改源码支持unix_timestamp() as DEFAULT value
- Fundamentals of machine learning (III) -- KNN / naive Bayes / cross validation / grid search
- R语言使用lubridate包处理日期和时间数据实战
- Realizing deep learning framework from zero -- LSTM from theory to practice [practice]
- Debezium系列之:IDEA集成词法和语法分析ANTLR,查看debezium支持的ddl、dml等语句
- word如何转换成pdf?word转pdf简单的方法分享!
- Reflection and imagination on the notation like tool
- Summer Challenge database Xueba notes, quick review of exams / interviews~
猜你喜欢

不愧是大佬,字节大牛耗时八个月又一力作

开源 SPL 消灭数以万计的数据库中间表
PHP利用ueditor实现上传图片添加水印
PHP uses ueditor to upload pictures and add watermarks

Apprentissage du projet MMO I: préchauffage

Why can't Bi software do correlation analysis? Take you to analyze

微波雷达感应模块技术,实时智能检测人体存在,静止微小动静感知

Interviewer: what is the difference between redis expiration deletion strategy and memory obsolescence strategy?

全网最全的低代码/无代码平台盘点:简道云、伙伴云、明道云、轻流、速融云、集简云、Treelab、钉钉·宜搭、腾讯云·微搭、智能云·爱速搭、百数云

Debezium系列之:记录mariadb数据库删除多张临时表debezium解析到的消息以及解决方法
随机推荐
Analysis of postman core functions - parameterization and test report
1亿单身男女撑起一个IPO,估值130亿
Is it safe for China Galaxy Securities to open an account? Securities account opening
Postman核心功能解析-参数化和测试报告
Android interview, Android audio and video development
Mariadb root用户及普通用户的密码 重置
Pandora IOT development board learning (HAL Library) - Experiment 8 timer interrupt experiment (learning notes)
Common interview questions in Android, 2022 golden nine silver ten Android factory interview questions hit
UDF implementation of Dameng database
[Collection - industry solutions] how to build a high-performance data acceleration and data editing platform
完爆面试官,一线互联网企业高级Android工程师面试题大全
Technology sharing | common interface protocol analysis
信息/数据
Go语言 | 01 WSL+VSCode环境搭建避坑指南
What are the reliable domestic low code development platforms?
UWB超宽带定位技术,实时厘米级高精度定位应用,超宽带传输技术
手机开户选择哪家券商公司比较好哪家平台更安全
Millimeter wave radar human body sensor, intelligent perception of static presence, human presence detection application
国海证券在网上开户安全吗?
golang通过指针for...range实现切片中元素的值的更改