当前位置:网站首页>【无标题】
【无标题】
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()边栏推荐
- OpenCV VideoCapture. Get() parameter details
- 十二、启动流程
- 【雅思口语】安娜口语学习记录part1
- 基於 QEMUv8 搭建 OP-TEE 開發環境
- [leetcode daily clock in] 1020 Number of enclaves
- C # réalise la liaison des données du rapport Crystal et l'impression du Code à barres 4
- 【LeetCode】19、 删除链表的倒数第 N 个结点
- Unity3d minigame unity webgl transform plug-in converts wechat games to use dlopen, you need to use embedded 's problem
- 2022-07-05 stonedb的子查询处理解析耗时分析
- UDP编程
猜你喜欢

Clip +json parsing converts the sound in the video into text

0 basic learning C language - digital tube

软考高级(信息系统项目管理师)高频考点:项目质量管理

Oracle control file and log file management

Management background --4, delete classification

C# 三种方式实现Socket数据接收

二叉(搜索)树的最近公共祖先 ●●

Seata聚合 AT、TCC、SAGA 、 XA事务模式打造一站式的分布式事务解决方案

Leetcode question brushing (XI) -- sequential questions brushing 51 to 55

A Mexican airliner bound for the United States was struck by lightning after taking off and then returned safely
随机推荐
i.mx6ull搭建boa服务器详解及其中遇到的一些问题
Management background --4, delete classification
3DMAX assign face map
中国1,4-环己烷二甲醇(CHDM)行业调研与投资决策报告(2022版)
小常识:保险中的“保全”是什么?
volatile关键字
The SQL response is slow. What are your troubleshooting ideas?
Senior soft test (Information System Project Manager) high frequency test site: project quality management
Aardio - 利用customPlus库+plus构造一个多按钮组件
NPDP认证|产品经理如何跨职能/跨团队沟通?
剑指offer刷题记录1
自制J-Flash烧录工具——Qt调用jlinkARM.dll方式
AI 企业多云存储架构实践 | 深势科技分享
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
ResNet-RS:谷歌领衔调优ResNet,性能全面超越EfficientNet系列 | 2021 arxiv
go多样化定时任务通用实现与封装
Unity3D学习笔记6——GPU实例化(1)
2022-07-04 mysql的高性能数据库引擎stonedb在centos7.9编译及运行
How do I write Flask's excellent debug log message to a file in production?
[Digital IC hand tearing code] Verilog burr free clock switching circuit | topic | principle | design | simulation