当前位置:网站首页>【无标题】
【无标题】
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()
边栏推荐
- A Mexican airliner bound for the United States was struck by lightning after taking off and then returned safely
- 中国1,4-环己烷二甲醇(CHDM)行业调研与投资决策报告(2022版)
- 做国外LEAD2022年下半年几点建议
- 硬件开发笔记(十): 硬件开发基本流程,制作一个USB转RS232的模块(九):创建CH340G/MAX232封装库sop-16并关联原理图元器件
- CCNA Cisco network EIGRP protocol
- 2022-07-05 stonedb sub query processing parsing time analysis
- C # réalise la liaison des données du rapport Crystal et l'impression du Code à barres 4
- 2022-07-04 the high-performance database engine stonedb of MySQL is compiled and run in centos7.9
- 雅思口语的具体步骤和时间安排是什么样的?
- 剪映+json解析将视频中的声音转换成文本
猜你喜欢
小常识:保险中的“保全”是什么?
MySQL数据库基本操作-DML
Unity3d minigame-unity-webgl-transform插件转换微信小游戏报错To use dlopen, you need to use Emscripten‘s...问题
LeetCode 练习——剑指 Offer 26. 树的子结构
Chapter 4: talk about class loader again
3DMax指定面贴图
Memorabilia of domestic database in June 2022 - ink Sky Wheel
PVL EDI 项目案例
[线性代数] 1.3 n阶行列式
Aardio - 封装库时批量处理属性与回调函数的方法
随机推荐
【雅思口语】安娜口语学习记录part1
Build op-tee development environment based on qemuv8
Attack and defense world miscall
The SQL response is slow. What are your troubleshooting ideas?
Anaconda installs third-party packages
SQL Server生成自增序号
Oracle-控制文件及日志文件的管理
Memorabilia of domestic database in June 2022 - ink Sky Wheel
A Mexican airliner bound for the United States was struck by lightning after taking off and then returned safely
基於 QEMUv8 搭建 OP-TEE 開發環境
【sdx62】WCN685X将bdwlan.bin和bdwlan.txt相互转化操作方法
lora同步字设置
2022-07-05 使用tpcc对stonedb进行子查询测试
ZABBIX proxy server and ZABBIX SNMP monitoring
Unity3d Learning Notes 6 - GPU instantiation (1)
重磅新闻 | Softing FG-200获得中国3C防爆认证 为客户现场测试提供安全保障
【LeetCode】19、 删除链表的倒数第 N 个结点
anaconda安装第三方包
Report on technological progress and development prospects of solid oxide fuel cells in China (2022 Edition)
Inno setup packaging and signing Guide