当前位置:网站首页>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 ')
边栏推荐
- JS realizes the animation effect of text and pictures in the visual area
- Mila, University of Ottawa | molecular geometry pre training with Se (3) invariant denoising distance matching
- Mila、渥太华大学 | 用SE(3)不变去噪距离匹配进行分子几何预训练
- 2022-02-13 (347. Top k high frequency elements)
- [set theory] set concept and relationship (set represents | number set | set relationship | contains | equality | set relationship property)
- [mathematical logic] predicate logic (toe normal form | toe normal form conversion method | basic equivalence of predicate logic | name changing rules | predicate logic reasoning law)
- Wine travel Jianghu War: Ctrip is strong, meituan is strong, and Tiktok is fighting
- Redraw and reflow
- Analysis of the reason why the server cannot connect remotely
- 2022-02-12 (338. Bit count)
猜你喜欢

Arthas watch grabs a field / attribute of the input parameter

JS realizes the animation effect of text and pictures in the visual area
![[nlp] - brief introduction to the latest work of spark neural network](/img/65/35ae0137f4030bdb2b0ab9acd85e16.png)
[nlp] - brief introduction to the latest work of spark neural network

用户体验五要素

redis 持久化原理

一名外包仔的2022年中总结

Deep dive kotlin synergy (19): flow overview

解决bp中文乱码

Data Lake three swordsmen -- comparative analysis of delta, Hudi and iceberg

Which Bluetooth headset is cost-effective? Four Bluetooth headsets with high cost performance are recommended
随机推荐
Design and implementation of JSP logistics center storage information management system
How to connect WiFi with raspberry pie
Jincang KFS data bidirectional synchronization scenario deployment
[Chongqing Guangdong education] reference materials for design and a better life of Zhongyuan Institute of science and technology
深潜Kotlin协程(十九):Flow 概述
MySQL create table
Kingbasees plug-in KDB of Jincang database_ exists_ expand
[dynamic programming] subsequence problem
PostgreSQL database high availability Patroni source code learning - etcd class
2022-02-14 (394. String decoding)
Xrandr modifier la résolution et le taux de rafraîchissement
[nlp] - brief introduction to the latest work of spark neural network
How to retrieve the password for opening word files
Daily question - ugly number
Competitive product analysis and writing
Kingbasees plug-in KDB of Jincang database_ database_ link
[literature reading] sparse in deep learning: practicing and growth for effective information and training in NN
mysql字段userid逗号分开保存按userid查询
Five elements of user experience
[fxcg] inflation differences will still lead to the differentiation of monetary policies in various countries