当前位置:网站首页>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'))




边栏推荐
- EMMC打印cqhci: timeout for tag 10提示分析与解决
- 【已解决】记一次EasyExcel的报错【读取xls文件时全表读不报错,指定sheet名读取报错】
- ForkJoin最全详解(从原理设计到使用图解)
- Distributed global ID generation scheme
- 微信小程序蓝牙连接硬件设备并进行通讯,小程序蓝牙因距离异常断开自动重连,js实现crc校验位
- Sidecar mode
- Senior programmers must know and master. This article explains in detail the principle of MySQL master-slave synchronization, and recommends collecting
- 消息队列:重复消息如何处理?
- MySQL-CentOS7通过YUM安装MySQL
- JVM the truth you need to know
猜你喜欢
AI face editor makes Lena smile
分布式事务解决方案之2PC
不同网段之间实现GDB远程调试功能
Design, configuration and points for attention of network specified source multicast (SSM) simulation using OPNET
Paper reading [MM21 pre training for video understanding challenge:video captioning with pre training techniqu]
Unity让摄像机一直跟随在玩家后上方
What are the common message queues?
nVisual网络可视化
得物客服一站式工作台卡顿优化之路
1. AVL tree: left-right rotation -bite
随机推荐
Différenciation et introduction des services groupés, distribués et microservices
4. Object mapping Mapster
Dj-zbs2 leakage relay
[paper reading] semi supervised left atrium segmentation with mutual consistency training
架构设计的五个核心要素
Explication contextuelle du langage Go
爬虫练习题(三)
The navigation bar changes colors according to the route
“多模态”概念
async / await
JVM the truth you need to know
消息队列:消息积压如何处理?
Leakage relay llj-100fs
Educational Codeforces Round 22 B. The Golden Age
Jhok-zbg2 leakage relay
[reading of the paper] a multi branch hybrid transformer network for channel terminal cell segmentation
[论文阅读] Semi-supervised Left Atrium Segmentation with Mutual Consistency Training
Design, configuration and points for attention of network specified source multicast (SSM) simulation using OPNET
Codeforces Round #416 (Div. 2) D. Vladik and Favorite Game
Differences and introduction of cluster, distributed and microservice