当前位置:网站首页>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 ')
边栏推荐
- Busycal latest Chinese version
- 深潜Kotlin协程(二十):构建 Flow
- MySQL create table
- 类的基础语法
- FFMpeg filter
- FuncS sh file not found when using the benchmarksql tool to test kingbases
- Five elements of user experience
- How to process the current cell with a custom formula in conditional format- How to address the current cell in conditional format custom formula?
- The 10th China Cloud Computing Conference · China Station: looking forward to the trend of science and technology in the next decade
- JS实现图片懒加载
猜你喜欢

2022-07-02: what is the output of the following go language code? A: Compilation error; B:Panic; C:NaN。 package main import “fmt“ func main() { var a =

The time has come for the domestic PC system to complete the closed loop and replace the American software and hardware system

会员积分商城系统的功能介绍

300+篇文献!一文详解基于Transformer的多模态学习最新进展

arthas watch 抓取入参的某个字段/属性

Nat. Comm. | use tensor cell2cell to deconvolute cell communication with environmental awareness

Five elements of user experience

跨境电商多商户系统怎么选

300+ documents! This article explains the latest progress of multimodal learning based on transformer

The latest activation free version of Omni toolbox
随机推荐
[free completion] development of course guidance platform (source code +lunwen)
Leecode swipe questions and record LCP 18 breakfast combination
一名外包仔的2022年中总结
[fxcg] inflation differences will still lead to the differentiation of monetary policies in various countries
金仓数据库KingbaseES 插件kdb_date_function
有监督预训练!文本生成又一探索!
Dismantle a 100000 yuan BYD "Yuan". Come and see what components are in it.
Mila, University of Ottawa | molecular geometry pre training with Se (3) invariant denoising distance matching
使用BENCHMARKSQL工具对KingbaseES预热数据时执行:select sys_prewarm(‘NDX_OORDER_2 ‘)报错
解决bp中文乱码
Web - Information Collection
Js/ts bottom implementation double click event
The 10th China Cloud Computing Conference · China Station: looking forward to the trend of science and technology in the next decade
Xrandr modifier la résolution et le taux de rafraîchissement
Arthas watch grabs a field / attribute of the input parameter
Daily question - ugly number
国产PC系统完成闭环,替代美国软硬件体系的时刻已经到来
Kingbasees plug-in KDB of Jincang database_ date_ function
Basic types of data in TS
重绘和回流