当前位置:网站首页>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'))边栏推荐
- How to convert word into PDF? Word to PDF simple way to share!
- Tupu software digital twin | visual management system based on BIM Technology
- Android面试,android音视频开发
- JMeter 常用的几种断言方法,你会了吗?
- 什么是面上项目
- Talking about fake demand from takeout order
- Oracle故障处理:Ora-10873:file * needs to be either taken out of backup or media recovered
- 测试外包公司怎么样?
- Hiengine: comparable to the local cloud native memory database engine
- Explain in detail the functions and underlying implementation logic of the groups sets statement in SQL
猜你喜欢

MMO项目学习一:预热
Mysql如何对json数据进行查询及修改

毫米波雷达人体感应器,智能感知静止存在,人体存在检测应用
Django uses mysqlclient service to connect and write to the database

面试官:Redis中集合数据类型的内部实现方式是什么?

司空见惯 - 英雄扫雷鼠

JAD installation, configuration and integration idea

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

大厂面试必备技能,2022Android不死我不倒

微波雷达感应模块技术,实时智能检测人体存在,静止微小动静感知
随机推荐
Applet modification style (placeholder, checkbox style)
Debezium系列之:解析默认值字符集
PG基础篇--逻辑结构管理(用户及权限管理)
Oracle fault handling: ora-10873:file * needs to be either taken out of backup or media recovered
打新债在哪里操作开户是更安全可靠的呢
Ultrasonic ranging based on FPGA
#夏日挑战赛# HarmonyOS - 实现消息通知功能
【AI 框架基础技术】自动求导机制 (Autograd)
C# 语言的基本语法结构
cf:B. Almost Ternary Matrix【對稱 + 找規律 + 構造 + 我是構造垃圾】
14、用户、组和权限(14)
Get wechat avatar and nickname with uniapp
Analysis of postman core functions - parameterization and test report
Android面试,android音视频开发
Go语言 | 02 for循环及常用函数的使用
S7-200SMART利用V90 MODBUS通信控制库控制V90伺服的具体方法和步骤
毫米波雷达人体感应器,智能感知静止存在,人体存在检测应用
Fuzor 2020 software installation package download and installation tutorial
PG basics -- Logical Structure Management (user and permission management)
从零实现深度学习框架——LSTM从理论到实战【实战】