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



边栏推荐
- Go 语言的 Context 详解
- "Multimodal" concept
- 爬虫练习题(三)
- What is message queuing?
- Paper reading [open book video captioning with retrieve copy generate network]
- 5阶多项式轨迹
- 分布式全局ID生成方案
- [binary tree] binary tree path finding
- The year of the tiger is coming. Come and make a wish. I heard that the wish will come true
- 常用消息队列有哪些?
猜你喜欢

Leakage relay jd1-100

分布式事务介绍

得物客服一站式工作台卡顿优化之路

三级菜单数据实现,实现嵌套三级菜单数据

Digital innovation driven guide

4. 对象映射 - Mapping.Mapster

An example of multi module collaboration based on NCF
![[论文阅读] Semi-supervised Left Atrium Segmentation with Mutual Consistency Training](/img/d6/e6db0d76e81e49a83a30f8c1832f09.png)
[论文阅读] Semi-supervised Left Atrium Segmentation with Mutual Consistency Training

Flink SQL realizes reading and writing redis and dynamically generates hset key

JVM the truth you need to know
随机推荐
[PM products] what is cognitive load? How to adjust cognitive load reasonably?
SAP ABAP BDC(批量数据通信)-018
Web Authentication API兼容版本信息
Explication contextuelle du langage Go
Lombok插件
《2022中国低/无代码市场研究及选型评估报告》发布
I didn't know it until I graduated -- the principle of HowNet duplication check and examples of weight reduction
论文阅读【Open-book Video Captioning with Retrieve-Copy-Generate Network】
Egr-20uscm ground fault relay
How does mapbox switch markup languages?
纪念下,我从CSDN搬家到博客园啦!
Hcip eighth operation
Go 语言的 Context 详解
Distributed global ID generation scheme
K6el-100 leakage relay
Design, configuration and points for attention of network unicast (one server, multiple clients) simulation using OPNET
How Alibaba cloud's DPCA architecture works | popular science diagram
JVM the truth you need to know
Go 語言的 Context 詳解
Use, configuration and points for attention of network layer protocol (taking QoS as an example) when using OPNET for network simulation