当前位置:网站首页>Crawl expression bag
Crawl expression bag
2022-07-29 08:00:00 【Zhao [email protected]】
[ Publish love net ](https://www.fabiaoqing.com/biaoqing/lists/page/1.html)
import requests,os
from lxml import etree
from fake_useragent import UserAgent
def crawl(url):
headers={
"User-Agent":UserAgent().chrome
}
# Get page response information
page_text=requests.get(url,headers).text
# Analyze the details page of the expression package url
tree=etree.HTML(page_text)
list_data=tree.xpath('//div[@class="ui segment imghover"]/div/a')
if not os.path.exists(' emoticon '):
os.mkdir(' emoticon ')
for i in list_data:
detail_url='https://www.fabiaoqing.com'+i.xpath('./@href')[0]
# print(detail_url)
# On the details page url Initiate request , Get a response
detail_page_text=requests.get(detail_url,headers).text
tree=etree.HTML(detail_page_text)
# Get the address of funny pictures , Initiate a request for persistent storage
detail_list_data=tree.xpath('//div[@class="swiper-wrapper"]/div/img/@src')[0]
fp=detail_list_data.split('/')[-1]
with open(' emoticon /'+fp, 'wb') as fp:
fp.write(requests.get(detail_list_data).content)
print(fp,' Download finished !!!')
# call
crawl('https://www.fabiaoqing.com/biaoqing/lists/page/1.html')
版权声明
本文为[Zhao [email protected]]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/210/202207290520357325.html
边栏推荐
- 10 common software architecture modes
- After the access database introduces DataGridView data, an error is displayed
- Character shader exercise
- 在一个sql文件中,上面定义一个测试表及数据,下面可以select* from 测试表
- Pytest set (7) - parameterization
- Unity beginner 3 - enemy movement control and setting of blood loss area (2D)
- V-Ray 5 acescg workflow settings
- Ansible (automation software)
- 207.课程表
- Space shooting Lesson 17: game over (end)
猜你喜欢
![[密码学实验] 0x00 安装NTL库](/img/2a/03d95082a2a63238b475b3f7f3e13d.png)
[密码学实验] 0x00 安装NTL库

@JsonSerialize注解的使用

Matrix decomposition and gradient descent

The smallest positive number that a subset of an array cannot accumulate

Qt/PyQt 窗口类型与窗口标志

Ionicons icon Encyclopedia

Amaze UI 图标查询

Convert source package to RPM package

Rotation in model space and rotation in world space

Do you want to meet all the needs of customers
随机推荐
Day 014 2D array exercise
Unity beginner 4 - frame animation and protagonist attack (2D)
Some simple uses of crawler requests Library
准备esp32环境
MySQL uses date_ FORMAT(date,'%Y-%m')
Up sampling deconvolution operation
Solve the problem that CSDN cannot publish blog due to unknown copyright
[experience] relevant configuration of remote connection to intranet server through springboard machine
Monitor the bottom button of page scrolling position positioning (including the solution that page initialization positioning does not take effect on mouse sliding)
Day 014 二维数组练习
[introduction to cryoelectron microscopy] Caltech open class course notes part 3:image formation
Go, how to become a gopher, and find work related to go language in 7 days, Part 1
Zip gzip tar compression Advanced Edition
[cryoelectron microscope] relion4.0 pipeline command summary (self use)
Access数据库引入datagridview数据后,显示错误
FLink CDC 的mysql connector中,mysql的字段是varbinary, 官方
Limitations of push down analysis
Ionicons icon Encyclopedia
黑盒测试常见错误类型说明及解决方法有哪些?
V-Ray 5 acescg workflow settings