当前位置:网站首页>Reptile exercises (III)
Reptile exercises (III)
2022-07-07 05:44:00 【InfoQ】
'''
1. Analyze the web :
https://www.6pian.cn/
https://www.6pian.cn/xq.html
https://www.6pian.cn/xq/1/0.html
https://www.6pian.cn/xq/2/0.html
https://www.6pian.cn/xq/3/0.html
'''
import urllib.request
start = int(input(" Please enter the start page "))
end = int(input(" Please enter the end page "))
headers = {
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.66 Safari/537.36 Edg/103.0.1264.44'
}
for n in range(start, end + 1):
url = 'https://www.6pian.cn/xq/{}/0.html'.format(n)
print(url)
q = urllib.request.Request(url,headers=headers)
response = urllib.request.urlopen(q)
with open(f' The first {n} page .html','w',encoding='utf-8')as f:
f.write(response.read().decode('utf-8'))
边栏推荐
- nodejs获取客户端ip
- 【已解决】记一次EasyExcel的报错【读取xls文件时全表读不报错,指定sheet名读取报错】
- Make web content editable
- Différenciation et introduction des services groupés, distribués et microservices
- [reading of the paper] a multi branch hybrid transformer network for channel terminal cell segmentation
- Lombok plug-in
- 高级程序员必知必会,一文详解MySQL主从同步原理,推荐收藏
- Zero sequence aperture of leakage relay jolx-gs62 Φ one hundred
- 论文阅读【Semantic Tag Augmented XlanV Model for Video Captioning】
- 架构设计的五个核心要素
猜你喜欢
Differences and introduction of cluster, distributed and microservice
Simple case of SSM framework
AI人脸编辑让Lena微笑
Common skills and understanding of SQL optimization
Zero sequence aperture of leakage relay jolx-gs62 Φ one hundred
[论文阅读] Semi-supervised Left Atrium Segmentation with Mutual Consistency Training
What is dependency injection (DI)
sql查询:将下一行减去上一行,并做相应的计算
SAP webservice 测试出现404 Not found Service cannot be reached
[PM products] what is cognitive load? How to adjust cognitive load reasonably?
随机推荐
Taobao commodity details page API interface, Taobao commodity list API interface, Taobao commodity sales API interface, Taobao app details API interface, Taobao details API interface
Modes of optical fiber - single mode and multimode
分布式事务解决方案之TCC
SQLSTATE[HY000][1130] Host ‘host. docker. internal‘ is not allowed to connect to this MySQL server
什么是依赖注入(DI)
Jhok-zbg2 leakage relay
The year of the tiger is coming. Come and make a wish. I heard that the wish will come true
Mapbox Chinese map address
Mybaits multi table query (joint query, nested query)
2pc of distributed transaction solution
"Multimodal" concept
[JS component] date display.
5. 数据访问 - EntityFramework集成
async / await
Codeforces Round #416 (Div. 2) D. Vladik and Favorite Game
The navigation bar changes colors according to the route
Getting started with DES encryption
K6el-100 leakage relay
Lombok插件
Go language context explanation