当前位置:网站首页>Reptile exercise 03
Reptile exercise 03
2022-07-03 04:24:00 【Mung east corner】
import requests
import os
from lxml import etree
if not os.path.exists('C:\\Users\\HP\\Desktop\\bizhi\\'):
os.makedirs('C:\\Users\\HP\\Desktop\\bizhi\\')
url='http://xinzhuobu.com/?cat=1&order=hot'
headers={"user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36 Edg/97.0.1072.76"}
page=requests.get(url=url,headers=headers).text
tree=etree.HTML(page)
img_list=tree.xpath('//div[@class="site"]/div[@class="site-content"]/div[@class="container"]/div[@class="row"]//div[@class="content-area"]//div[@class="row posts-wrapper"]/div[@class="col-lg-1-5 col-6 col-sm-6 col-md-4 col-lg-3"]')
a='1'
for i in img_list:
img_src=i.xpath('./article/div[@class="entry-media"]/div[@class="placeholder"]//img/@data-src')[0]
img_name=a+'.jpg'
a=str(int(a)+1)
imgg=requests.get(url=img_src,headers=headers).content
img_path="C:\\Users\\HP\\Desktop\\bizhi\\"+img_name
with open(img_path,'wb')as f:
f.write(imgg)
print(img_name,' Download successful ')
边栏推荐
- Kingbasees plug-in KDB of Jincang database_ database_ link
- 金仓KFS数据双向同步场景部署
- Dive into deep learning - 2.1 data operation & Exercise
- Wine travel Jianghu War: Ctrip is strong, meituan is strong, and Tiktok is fighting
- Classes in TS
- 金仓数据库KingbaseES 插件kdb_database_link
- Basic MySQL operations
- Which Bluetooth headset is cost-effective? Four Bluetooth headsets with high cost performance are recommended
- [set theory] set operation (Union | intersection | disjoint | relative complement | symmetric difference | absolute complement | generalized union | generalized intersection | set operation priority)
- Smart contract security audit company selection analysis and audit report resources download - domestic article
猜你喜欢

使用BENCHMARKSQL工具对KingbaseES预热数据时执行:select sys_prewarm(‘NDX_OORDER_2 ‘)报错

FFMpeg filter

The latest activation free version of Omni toolbox

【毕业季·进击的技术er】职场人的自白

Use the benchmarksql tool to perform a data prompt on kingbases. The jdbc driver cannot be found

How to retrieve the password for opening word files

Function introduction of member points mall system

有监督预训练!文本生成又一探索!

Prefix and (continuously updated)

CVPR 2022 | 大連理工提出自校准照明框架,用於現實場景的微光圖像增强
随机推荐
Joint set search: merge intervals and ask whether two numbers are in the same set
GFS分布式文件系统(光是遇见已经很美好了)
Daily question - ugly number
Mila、渥太华大学 | 用SE(3)不变去噪距离匹配进行分子几何预训练
Design and implementation of kubelet garbage collection mechanism to protect nodes from being preempted by containers image GC high threshold
Square root of X
Prefix and (continuously updated)
使用BENCHMARKSQL工具对kingbaseES执行灌数据提示无法找到JDBC driver
跨境电商多商户系统怎么选
300+ documents! This article explains the latest progress of multimodal learning based on transformer
xrandr修改分辨率与刷新率
PostgreSQL database high availability Patroni source code learning - etcd class
Ffmpeg mix
金仓KFS数据双向同步场景部署
Drf--- quick start 01
Writing skills of multi plate rotation strategy -- strategy writing learning materials
[fxcg] inflation differences will still lead to the differentiation of monetary policies in various countries
[set theory] set operation (Union | intersection | disjoint | relative complement | symmetric difference | absolute complement | generalized union | generalized intersection | set operation priority)
Which code editor is easy to use? Code editing software recommendation
Dive Into Deep Learning——2.1数据操作&&练习