当前位置:网站首页>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'))
边栏推荐
- Modes of optical fiber - single mode and multimode
- 拼多多商品详情接口、拼多多商品基本信息、拼多多商品属性接口
- [JS component] date display.
- Unity keeps the camera behind and above the player
- [reading of the paper] a multi branch hybrid transformer network for channel terminal cell segmentation
- SQL query: subtract the previous row from the next row and make corresponding calculations
- "Multimodal" concept
- R语言【逻辑控制】【数学运算】
- 1. AVL tree: left-right rotation -bite
- 《HarmonyOS实战—入门到开发,浅析原子化服务》
猜你喜欢
Leakage relay llj-100fs
Intelligent annotation scheme of entity recognition based on hugging Face Pre training model: generate doccano request JSON format
Simple case of SSM framework
CVE-2021-3156 漏洞复现笔记
How does mapbox switch markup languages?
ForkJoin最全详解(从原理设计到使用图解)
Flink SQL 实现读写redis,并动态生成Hset key
[reading of the paper] a multi branch hybrid transformer network for channel terminal cell segmentation
Distributed global ID generation scheme
Unity让摄像机一直跟随在玩家后上方
随机推荐
AI face editor makes Lena smile
AI人脸编辑让Lena微笑
Initial experience of annotation
数据中心为什么需要一套基础设施可视化管理系统
sql优化常用技巧及理解
消息队列:重复消息如何处理?
Distributed global ID generation scheme
Zero sequence aperture of leakage relay jolx-gs62 Φ one hundred
Simple case of SSM framework
Flink SQL realizes reading and writing redis and dynamically generates hset key
【已解决】记一次EasyExcel的报错【读取xls文件时全表读不报错,指定sheet名读取报错】
R语言【逻辑控制】【数学运算】
Educational Codeforces Round 22 B. The Golden Age
[paper reading] semi supervised left atrium segmentation with mutual consistency training
Go language context explanation
1. AVL tree: left-right rotation -bite
爬虫练习题(三)
Go 語言的 Context 詳解
论文阅读【Sensor-Augmented Egocentric-Video Captioning with Dynamic Modal Attention】
"Multimodal" concept