当前位置:网站首页>【无标题】
【无标题】
2022-07-06 14:53:00 【freshfox】
#-*- coding:utf-8 -*-
from bs4 import BeautifulSoup
import requests
def get_imgs(xml_name = 'output.xml'):
file = open('1.html', encoding='utf-8').read()
soup = BeautifulSoup(file, 'xml')
count =0
try :
for node in soup.findChildren('img'):
src = node['src']
count =count+1
if count > 3:
break
print ("src : " + src)
response = requests.get(src)
img = response.content
path = '%s.jpg' % (count)
with open(path, 'wb') as f:
f.write(img)
except Exception as e:
print("get exception " + e)
get_imgs()
边栏推荐
- 2022-07-05 stonedb sub query processing parsing time analysis
- 3DMax指定面贴图
- Hardware development notes (10): basic process of hardware development, making a USB to RS232 module (9): create ch340g/max232 package library sop-16 and associate principle primitive devices
- HDR image reconstruction from a single exposure using deep CNNs阅读札记
- pytorch_YOLOX剪枝【附代码】
- 二分图判定
- 图像的spatial domain 和 frequency domain 图像压缩
- Unity3d minigame-unity-webgl-transform插件转换微信小游戏报错To use dlopen, you need to use Emscripten‘s...问题
- That's why you can't understand recursion
- UDP编程
猜你喜欢
Unity3d minigame-unity-webgl-transform插件转换微信小游戏报错To use dlopen, you need to use Emscripten‘s...问题
The nearest common ancestor of binary (search) tree ●●
signed、unsigned关键字
Installation and use of labelimg
MySQL数据库基本操作-DML
Senior soft test (Information System Project Manager) high frequency test site: project quality management
2022年6月国产数据库大事记-墨天轮
Classic sql50 questions
[linear algebra] determinant of order 1.3 n
2500个常用中文字符 + 130常用中英文字符
随机推荐
Unity3d minigame-unity-webgl-transform插件转换微信小游戏报错To use dlopen, you need to use Emscripten‘s...问题
Unity3D学习笔记6——GPU实例化(1)
剪映+json解析将视频中的声音转换成文本
Dealing with the crash of QT quick project in offscreen mode
2022年6月国产数据库大事记-墨天轮
volatile关键字
ResNet-RS:谷歌领衔调优ResNet,性能全面超越EfficientNet系列 | 2021 arxiv
case 关键字后面的值有什么要求吗?
Aardio - 不声明直接传float数值的方法
Clip +json parsing converts the sound in the video into text
如何用程序确认当前系统的存储模式?
【sdx62】WCN685X将bdwlan.bin和bdwlan.txt相互转化操作方法
How do I write Flask's excellent debug log message to a file in production?
PVL EDI 项目案例
Chapter 3: detailed explanation of class loading process (class life cycle)
Assembly and interface technology experiment 5-8259 interrupt experiment
China 1,4-cyclohexanedimethanol (CHDM) industry research and investment decision-making report (2022 Edition)
图像的spatial domain 和 frequency domain 图像压缩
Gd32f4xx serial port receive interrupt and idle interrupt configuration
2500个常用中文字符 + 130常用中英文字符