当前位置:网站首页>唯美girls
唯美girls
2022-07-29 05:23:00 【赵颂@】
import requests ,re
from fake_useragent import UserAgent
import time,os
#请求网页
url="https://www.vmgirls.com/13344.html"
headers ={
"User-Agent":UserAgent().chrome
}
#表明自己的一个身份
r=requests.get(url,headers=headers)
#print(r.request.headers) #查看头部信息
#print(r.text)
html =r.text
#解析网页
dirname=re.findall('<h1 class="post-title h3">(.*?)</h1>',html)[0]
result =re.findall('<a href="(.*?)" alt=".*?" title=".*?">',html)
if not os.path.exists(dirname):
os.mkdir(dirname)
#保存图皮片
for url in result:
time.sleep(1)
#图片的名字
filename=url.split("/")[-1]
print("正在下载:"+filename)
r = requests.get(url, headers=headers)
with open (dirname+ "/" +filename,"wb")as f:
f.write(r.content)
边栏推荐
- HAL库学习笔记-13 I2C和SPI的应用
- 网络爬虫
- QT learning notes QtSql
- Open source based on STM32: MHD Bluetooth speaker (including source code +pcb)
- FPGA based: moving target detection (schematic + source code + hardware selection, available)
- 传统模型预测控制轨迹跟踪——波浪形轨迹(功能包已经更新)
- Model building in pytorch
- Based on stc51: schematic diagram and source code of four axis flight control open source project (entry-level DIY)
- Hal learning notes - Basic timer of 7 timer
- 2.4G频段的无线收发芯片 SI24R1 问题汇总解答
猜你喜欢

HAL库学习笔记-14 ADC和DAC

Hal library learning notes-14 ADC and DAC

Pytorch Basics (Introductory)

HAL学习笔记 - 7 定时器之高级定时器

Huawei cloud 14 day Hongmeng device development -day5 drive subsystem development

噪声传感器工作原理是什么?

Hal library learning notes - 8 use of serial communication

华为云14天鸿蒙设备开发-Day5驱动子系统开发

2022 spring recruit - Hesai technology FPGA technology post (one or two sides, collected from: Digital IC workers and FPGA Explorers)

基于51单片机的直流电机调速系统(L298的使用)
随机推荐
基于DAC0832的直流电机控制系统
三国演义章节内容
Reading papers on fake news detection (2): semi supervised learning and graph neural networks for fake news detection
链表--------------------尾插法
【软件工程之美 - 专栏笔记】13 | 白天开会,加班写代码的节奏怎么破?
HAL库学习笔记-12 SPI
SimpleFOC调参3-PID参数整定攻略
2022 spring recruit - Shanghai an road FPGA post Manager (and Lexin SOC interview)
Logistic regression - project practice - credit card detection task (Part 2)
【软件工程之美 - 专栏笔记】19 | 作为程序员,你应该有产品意识
新能源充电桩后台管理系统平台
Ml8 self study notes LDA principle formula derivation
Huawei cloud 14 day Hongmeng device development -day2 compilation framework
多线程和并发
Transformer review + understanding
DP1332E多协议高度集成非接触式读写芯片
【软件工程之美 - 专栏笔记】24 | 技术债务:是继续修修补补凑合着用,还是推翻重来?
STM32 MDK(Keil5) Contents mismatch错误总结
STM32 串口乱码
抽象类以及接口