Python学习从0开始——项目一day01爬虫

news2025/6/22 16:18:05

Python学习从0开始——项目一day01爬虫

  • 一、导入代码
  • 二、使用的核心库
  • 三、功能测试
    • 3.1初始代码
    • 3.2新建文件
    • 3.3代码调试
  • 四、页面元素解析
    • 4.1网页
    • 4.2修改代码
    • 4.3子页面
    • 4.4修改代码

一、导入代码

在Inscode新建一个python类型的项目,然后打开终端,粘贴以下代码,回车clone项目。

git clone https://gitee.com/52itstyle/Python.git

这个是gitee上找的一个python项目,项目源地址。

二、使用的核心库

requests库是第三方库,使用其提供的API比使用python自带的urllib更为简洁,且能够处理多种HTTP请求,功能也很强大。

#导入requests库
import requests
#导入文件操作库
import os
#bs4全名BeautifulSoup,是编写python爬虫常用库之一,主要用来解析html标签。
import bs4
from bs4 import BeautifulSoup
#基础类库
import sys
#Python 3.x 解决中文编码问题
import importlib
importlib.reload(sys)

三、功能测试

3.1初始代码

初始代码位置:Python/Day01/脚本,打开终端运行命令:

#切换目录
cd Python/Day01/脚本
#输出
/root/Python_02/Python/Day01/脚本
#运行脚本
python3 mzitu_linux.py
#输出报错
File "/root/Python_02/Python/Day01/脚本/mzitu_linux.py", line 21
    save_path ='/mnt/data/mzitu'
                ^
SyntaxError: invalid non-printable character U+200B

#打开mzitu_linux.py文件,定位原代码21行,修改save_path
save_path ='./picture'
#打开56、68、72行的注释
#重新运行
python3 mzitu_linux.py
#很慢,把网址复制到浏览器直接拒绝访问
键盘Ctrl+C组合停止运行

3.2新建文件

在脚本的同级目录下新进learn文件夹,新建spider.py文件,将mzitu_linux.py里的内容复制过来
在这里插入图片描述

3.3代码调试

#问题一:网站不可访问。解决:修改爬图地址
#定位代码18行
mziTu = 'https://image.baidu.com/'
#终端执行
cd ../
cd learn/
python3 spider.py
#输出报错
Traceback (most recent call last):
  File "/root/Python_02/Python/Day01/learn/spider.py", line 106, in <module>
    main()
  File "/root/Python_02/Python/Day01/learn/spider.py", line 90, in main
    img_max = soup.find('div', class_='nav-links').find_all('a')[3].text
AttributeError: 'NoneType' object has no attribute 'find_all'

以上报错是正常的,切换爬取网站后,页面元素的解析肯定会发生改变,接下来一步步修改解析。

四、页面元素解析

4.1网页

#进入百度图片的网址
https://image.baidu.com/

键盘F12调出控制台,切换到Element标签页,组合键Ctrl+Shift+C选中合辑的图片,然后审查元素。
在这里插入图片描述
选中’<a>'标签,右键copy>copy emelemt审查元素,关注target和href

<a class="bd-home-content-album-item             
" target="_blank" href="https://image.baidu.com/search/albumsdetail?tn=albumsdetail&amp;word=%E5%9F%8E%E5%B8%82%E5%BB%BA%E7%AD%91%E6%91%84%E5%BD%B1%E4%B8%93%E9%A2%98&amp;fr=searchindex_album%20&amp;album_tab=%E5%BB%BA%E7%AD%91&amp;album_id=7&amp;rn=30" data-type="0"> 
	<div class="bd-home-content-album-item-pic" style="background-image: url(https://t7.baidu.com/it/u=1595072465,3644073269&amp;fm=193&amp;f=GIF); background-color: #EACFC5"> 
	</div> 
	<div class="bd-home-content-album-item-inner-border"></div> 
	<div class="bd-home-content-album-item-title"> 城市建筑摄影专题  </div> 
</a>

选中’<a>'标签,右键copy>copy selector复制选择器

#bd-home-content-album > a:nth-child(1)

由以上可推:根据元素的唯一id:‘bd-home-content-album’可以找到’<div>‘标签内的所有’<a>‘标签,当前复制的’<a>‘标签是其父元素的第一个子’<a>'元素。

4.2修改代码

#修改39行
# 获取页面的栏目地址
    all_a = soup_sub.find('div',id='bd-home-content-album').find_all('a',target='_blank')
# 修改主方法,此页面无分页
def main():
    res = requests.get(mziTu, headers=headers)
    # 使用自带的html.parser解析
    soup = BeautifulSoup(res.text, 'html.parser')
    # 创建文件夹
    createFile(save_path)
    file = save_path
    createFile(file)
    print("开始执行")
    download(mziTu, file)

切换到终端,运行脚本:

python3 spider.py 
#输出报错
开始执行
内页第几页:2
套图地址:https://image.baidu.com/search/albumsdetail?tn=albumsdetail&word=%E6%B8%90%E5%8F%98%E9%A3%8E%E6%A0%BC%E6%8F%92%E7%94%BB&fr=albumslist&album_tab=%E8%AE%BE%E8%AE%A1%E7%B4%A0%E6%9D%90&album_id=409&rn=30
'NoneType' object has no attribute 'find_all'
内页第几页:4
套图地址:https://image.baidu.com/search/albumsdetail?tn=albumsdetail&word=%E5%AE%A0%E7%89%A9%E5%9B%BE%E7%89%87&fr=albumslist&album_tab=%E5%8A%A8%E7%89%A9&album_id=688&rn=30
'NoneType' object has no attribute 'find_all'
内页第几页:6
套图地址:https://image.baidu.com/search/albumslist?tn=albumslist&word=%E4%BA%BA%E7%89%A9&album_tab=%E4%BA%BA%E7%89%A9&rn=15&fr=searchindex_album
'NoneType' object has no attribute 'find_all'

父页面解析的元素和初始代码不同,子页面也不同,继续修改。

4.3子页面

复制打印的套图地址进入子页面,同样的操作,定位子页面图片:

<a class="albumsdetail-item" href="/search/detail?tn=baiduimagedetail&amp;word=%E5%9F%8E%E5%B8%82%E5%BB%BA%E7%AD%91%E6%91%84%E5%BD%B1%E4%B8%93%E9%A2%98&amp;album_tab=%E5%BB%BA%E7%AD%91&amp;album_id=7&amp;ie=utf-8&amp;fr=albumsdetail&amp;cs=1595072465,3644073269&amp;pi=3977&amp;pn=0&amp;ic=0&amp;objurl=https%3A%2F%2Ft7.baidu.com%2Fit%2Fu%3D1595072465%2C3644073269%26fm%3D193%26f%3DGIF" target="_blank" data-index="0" width="310.4" style="width: 310.4px; height: 310px;">
	<img class="albumsdetail-item-img" src="https://t7.baidu.com/it/u=1595072465,3644073269&amp;fm=193&amp;f=GIF" style="width: 310.4px; height: 310px; background-color: rgb(234, 207, 197);">
	<div class="albumsdetail-item-inner-border"></div>
</a>

元素选择器:

#imgList > div:nth-child(1) > a:nth-child(1)

数量元素选择器:

#bd-albumsdetail-content > div.albumsdetail-cover.clearfix > div.albumsdetail-info > div.albumsdetail-info-text > p.albumsdetail-info-num > span

4.4修改代码

#修改53行,也可以根据元素去获取这个数值,在这不是重点,直接赋值了
# 获取套图的最大数量
                pic_max = "791"
#修改62行
                    img = soup_sub_2.find('div',id='imgList').find('img')
#切换终端执行代码
python3 spider.py 
#输出报错
开始执行
内页第几页:2
套图地址:https://image.baidu.com/search/albumsdetail?tn=albumsdetail&word=%E6%B8%90%E5%8F%98%E9%A3%8E%E6%A0%BC%E6%8F%92%E7%94%BB&fr=albumslist&album_tab=%E8%AE%BE%E8%AE%A1%E7%B4%A0%E6%9D%90&album_id=409&rn=30
套图数量:791
子内页第几页:1
https://image.baidu.com/search/albumsdetail?tn=albumsdetail&word=%E6%B8%90%E5%8F%98%E9%A3%8E%E6%A0%BC%E6%8F%92%E7%94%BB&fr=albumslist&album_tab=%E8%AE%BE%E8%AE%A1%E7%B4%A0%E6%9D%90&album_id=409&rn=30/1
'NoneType' object has no attribute 'find'
内页第几页:4
套图地址:https://image.baidu.com/search/albumsdetail?tn=albumsdetail&word=%E5%AE%A0%E7%89%A9%E5%9B%BE%E7%89%87&fr=albumslist&album_tab=%E5%8A%A8%E7%89%A9&album_id=688&rn=30
套图数量:791
子内页第几页:1
https://image.baidu.com/search/albumsdetail?tn=albumsdetail&word=%E5%AE%A0%E7%89%A9%E5%9B%BE%E7%89%87&fr=albumslist&album_tab=%E5%8A%A8%E7%89%A9&album_id=688&rn=30/1
'NoneType' object has no attribute 'find'
内页第几页:6
套图地址:https://image.baidu.com/search/albumslist?tn=albumslist&word=%E4%BA%BA%E7%89%A9&album_tab=%E4%BA%BA%E7%89%A9&rn=15&fr=searchindex_album
套图数量:791
子内页第几页:1
https://image.baidu.com/search/albumslist?tn=albumslist&word=%E4%BA%BA%E7%89%A9&album_tab=%E4%BA%BA%E7%89%A9&rn=15&fr=searchindex_album/1
'NoneType' object has no attribute 'find'

明明已经根据元素选择器来查找了,为什么没有找到元素呢?打印父元素看看:

#63行插入打印父元素
                    print(soup_sub_2.find('div',id='bd-albumsdetail-content'))
#终端执行
python3 spider.py 
#输出
<div id="bd-albumsdetail-content">
</div>

问题找到了,根本原因是该div内的元素是在运行时动态渲染和加载的,造成我们通过浏览器访问是能看到该元素的,但是爬虫爬不到。这就需要我们另想办法解决。
是否是动态渲染,我们可以更早的发现:

打开控制台,切换到network,可以看到多次发送的请求,这些请求网址实际上来自
在这里插入图片描述
查看第一条请求的返回值,随便选择一条发送图片的请求复制参数,在response页Ctrl+F调出搜索框,定位返回值所在位置。
在这里插入图片描述

详细数据如下,稍微调整了一下格式:

linkData: '[{\x22pid\x22:3977,\x22width\x22:1100,\x22height\x22:1100,\x22oriwidth\x22:1200,\x22oriheight\x22:1200,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=1595072465,3644073269&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/811557570\x22,\x22contSign\x22:\x221595072465,3644073269\x22},
{\x22pid\x22:3978,\x22width\x22:1200,\x22height\x22:800,\x22oriwidth\x22:1200,\x22oriheight\x22:800,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=4198287529,2774471735&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.veer.com\\\/photo\\\/147317368?utm_source=baidu&utm_medium=imagesearch&chid=902\x22,\x22contSign\x22:\x224198287529,2774471735\x22},
{\x22pid\x22:3979,\x22width\x22:1200,\x22height\x22:813,\x22oriwidth\x22:1200,\x22oriheight\x22:813,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=1956604245,3662848045&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/809773493\x22,\x22contSign\x22:\x221956604245,3662848045\x22},
{\x22pid\x22:3980,\x22width\x22:1200,\x22height\x22:760,\x22oriwidth\x22:1200,\x22oriheight\x22:760,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=2529476510,3041785782&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/805192561\x22,\x22contSign\x22:\x222529476510,3041785782\x22},
{\x22pid\x22:3981,\x22width\x22:1200,\x22height\x22:800,\x22oriwidth\x22:1200,\x22oriheight\x22:800,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=727460147,2222092211&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/811065917\x22,\x22contSign\x22:\x22727460147,2222092211\x22},
{\x22pid\x22:3982,\x22width\x22:1200,\x22height\x22:800,\x22oriwidth\x22:1200,\x22oriheight\x22:800,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=2511982910,2454873241&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/810968731\x22,\x22contSign\x22:\x222511982910,2454873241\x22},
{\x22pid\x22:3983,\x22width\x22:1200,\x22height\x22:686,\x22oriwidth\x22:1200,\x22oriheight\x22:686,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=825057118,3516313570&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/810073156\x22,\x22contSign\x22:\x22825057118,3516313570\x22},
{\x22pid\x22:3984,\x22width\x22:1200,\x22height\x22:800,\x22oriwidth\x22:1200,\x22oriheight\x22:800,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=3435942975,1552946865&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/811932564\x22,\x22contSign\x22:\x223435942975,1552946865\x22},
{\x22pid\x22:3985,\x22width\x22:1200,\x22height\x22:800,\x22oriwidth\x22:1200,\x22oriheight\x22:800,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=3569419905,626536365&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/809770618\x22,\x22contSign\x22:\x223569419905,626536365\x22},
{\x22pid\x22:3986,\x22width\x22:1200,\x22height\x22:800,\x22oriwidth\x22:1200,\x22oriheight\x22:800,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=3779234486,1094031034&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/810970358\x22,\x22contSign\x22:\x223779234486,1094031034\x22},
{\x22pid\x22:3987,\x22width\x22:1200,\x22height\x22:482,\x22oriwidth\x22:1200,\x22oriheight\x22:482,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=2397542458,3133539061&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/811063723\x22,\x22contSign\x22:\x222397542458,3133539061\x22},
{\x22pid\x22:3988,\x22width\x22:1200,\x22height\x22:800,\x22oriwidth\x22:1200,\x22oriheight\x22:800,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=2763645735,2016465681&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/809771013\x22,\x22contSign\x22:\x222763645735,2016465681\x22},
{\x22pid\x22:3989,\x22width\x22:1149,\x22height\x22:1100,\x22oriwidth\x22:1200,\x22oriheight\x22:1149,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=3911840071,2534614245&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/810877786\x22,\x22contSign\x22:\x223911840071,2534614245\x22},
{\x22pid\x22:3990,\x22width\x22:1200,\x22height\x22:687,\x22oriwidth\x22:1200,\x22oriheight\x22:687,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=3908717,2002330211&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/810968672\x22,\x22contSign\x22:\x223908717,2002330211\x22},
{\x22pid\x22:3991,\x22width\x22:1200,\x22height\x22:799,\x22oriwidth\x22:1200,\x22oriheight\x22:799,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=318887420,2894941323&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/810056726\x22,\x22contSign\x22:\x22318887420,2894941323\x22},
{\x22pid\x22:3992,\x22width\x22:1200,\x22height\x22:800,\x22oriwidth\x22:1200,\x22oriheight\x22:800,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=1063451194,1129125124&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.veer.com\\\/photo\\\/146287060?utm_source=baidu&utm_medium=imagesearch&chid=902\x22,\x22contSign\x22:\x221063451194,1129125124\x22},
{\x22pid\x22:3993,\x22width\x22:800,\x22height\x22:1200,\x22oriwidth\x22:800,\x22oriheight\x22:1200,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=3785402047,1898752523&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/810970018\x22,\x22contSign\x22:\x223785402047,1898752523\x22},
{\x22pid\x22:3994,\x22width\x22:1200,\x22height\x22:800,\x22oriwidth\x22:1200,\x22oriheight\x22:800,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=3691080281,11347921&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/809782140\x22,\x22contSign\x22:\x223691080281,11347921\x22},
{\x22pid\x22:3995,\x22width\x22:1200,\x22height\x22:799,\x22oriwidth\x22:1200,\x22oriheight\x22:799,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=2374506090,1216769752&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.veer.com\\\/photo\\\/146290795?utm_source=baidu&utm_medium=imagesearch&chid=902\x22,\x22contSign\x22:\x222374506090,1216769752\x22},
{\x22pid\x22:3996,\x22width\x22:1200,\x22height\x22:800,\x22oriwidth\x22:1200,\x22oriheight\x22:800,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=1285847167,3193778276&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/809771315\x22,\x22contSign\x22:\x221285847167,3193778276\x22},
{\x22pid\x22:3997,\x22width\x22:1200,\x22height\x22:800,\x22oriwidth\x22:1200,\x22oriheight\x22:800,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=3251197759,2520670799&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/814059806\x22,\x22contSign\x22:\x223251197759,2520670799\x22},
{\x22pid\x22:3998,\x22width\x22:1200,\x22height\x22:800,\x22oriwidth\x22:1200,\x22oriheight\x22:800,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=602106375,407124525&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/813923414\x22,\x22contSign\x22:\x22602106375,407124525\x22},
{\x22pid\x22:3999,\x22width\x22:1200,\x22height\x22:800,\x22oriwidth\x22:1200,\x22oriheight\x22:800,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=2906406936,2666005453&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/811706433\x22,\x22contSign\x22:\x222906406936,2666005453\x22},
{\x22pid\x22:4000,\x22width\x22:1200,\x22height\x22:798,\x22oriwidth\x22:1200,\x22oriheight\x22:798,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=3124693600,356058981&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/805197127\x22,\x22contSign\x22:\x223124693600,356058981\x22},
{\x22pid\x22:4001,\x22width\x22:1200,\x22height\x22:800,\x22oriwidth\x22:1200,\x22oriheight\x22:800,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=3646282624,1156077026&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/810999167\x22,\x22contSign\x22:\x223646282624,1156077026\x22},
{\x22pid\x22:4002,\x22width\x22:1200,\x22height\x22:797,\x22oriwidth\x22:1200,\x22oriheight\x22:797,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=4158958181,280757487&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/810880655\x22,\x22contSign\x22:\x224158958181,280757487\x22},
{\x22pid\x22:4003,\x22width\x22:1200,\x22height\x22:800,\x22oriwidth\x22:1200,\x22oriheight\x22:800,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=2371362259,3988640650&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/809782065\x22,\x22contSign\x22:\x222371362259,3988640650\x22},
{\x22pid\x22:4004,\x22width\x22:800,\x22height\x22:1200,\x22oriwidth\x22:800,\x22oriheight\x22:1200,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=355704943,1318565630&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/810998065\x22,\x22contSign\x22:\x22355704943,1318565630\x22},
{\x22pid\x22:4005,\x22width\x22:1200,\x22height\x22:800,\x22oriwidth\x22:1200,\x22oriheight\x22:800,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=655876807,3707807800&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/809770741\x22,\x22contSign\x22:\x22655876807,3707807800\x22},
{\x22pid\x22:4006,\x22width\x22:1200,\x22height\x22:800,\x22oriwidth\x22:1200,\x22oriheight\x22:800,\x22thumbnailUrl\x22:\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=1423490396,3473826719&fm=193&f=GIF\x22,\x22fromUrl\x22:\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/811796379\x22,\x22contSign\x22:\x221423490396,3473826719\x22}]',
               

拿出一条数据来看:

{\x22pid\x22:4006,
\x22width\x22:1200,
\x22height\x22:800,
\x22oriwidth\x22:1200,
\x22oriheight\x22:800,
\x22thumbnailUrl\x22:
\x22https:\\\/\\\/t7.baidu.com\\\/it\\\/u=1423490396,3473826719&fm=193&f=GIF\x22,
\x22fromUrl\x22:
\x22https:\\\/\\\/www.vcg.com\\\/creative\\\/811796379\x22,\x22contSign\x22:\x221423490396,3473826719\x22}]',

下一篇继续。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1584692.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

高中数学:三角函数-基础知识

一、任意角 顺时针旋转是负值角 逆时针旋转式正值角 一个角对应一个终边 一个终边对应无数个角 xk*360 例题 二、弧度制 弧长与半径的比值&#xff0c;就是角度 常见角度与弧度的对应关系 例题 三、弧长与扇形面积公式 注意&#xff1a;弧度制下的扇形面积公式&#x…

SpringBoot --pagehelper分页

目录 1.建立数据库 2.页面显示 3.基本逻辑 4.配置依赖 5.使用pagehelper 6.页面列表 页面 效果 1.建立数据库 create database if not exists my_book; use my_book; create table if not exists myBook (id int primary key auto_increment,name varchar(50) not …

Python(4):函数(命名+参数+内置函数+匿名函数)

文章目录 一、关于*的一些打散功能二、函数的特点和命名规范三、函数的返回值return四、函数的参数1.无参数的函数2.有参数的函数 五、函数的命名空间六、全局变量和局部变量七、函数的作用域以及执行顺序(LEGB)八、递归函数九、常见内置函数十、匿名函数-lambda 一、关于*的一…

c++的学习之路:11、string(3)

昨天写string的时候没有说全&#xff0c;这里就开始接着讲。 目录 一、resize 二、insert 三、erase 一、resize 昨天说这个的时候没有考虑到缩小范围时咋处理&#xff0c;然后发现报错了&#xff0c;接着我调试发现缩小就不能正常执行了&#xff0c;因为用的是strcap所以…

芯片设计围炉札记

文章目录 语言Verilog 和 VHDL 区别 芯片验证 语言 System Verilog的概念以及与verilog的对比 IC 设计软件分析 Verilog 和 VHDL 区别 Verilog HDL 和 VHDL 的区别如下&#xff1a; 语法结构&#xff1a;Verilog的语法结构类似于C语言&#xff0c;而VHDL的语法结构则更接近…

流程图步骤条

1.结构 <ul class"stepUl"> <li class"stepLi" v-for"(item, index) in stepList" :key"index"> <div class"top"> <p :class"{active: currentState > item.key}">{{ item.value }}…

没有公网IP怎么办?

在网络通信中&#xff0c;公网IP是指可以直接访问互联网的IP地址。由于各种原因&#xff0c;有一些用户可能没有自己的公网IP地址。那么没有公网IP的情况下&#xff0c;我们应该怎么办呢&#xff1f; 局域网的限制 我们需要了解局域网的概念。局域网是指在一个相对较小的范围内…

R语言记录过程

如何使用这个函数as.peakData 函数构造过程 出现问题是缺少函数的问题 up不告诉我&#xff0c;这里是代表c,h,o的值&#xff0c;你从里面获取把值&#xff0c;设置成c,h,o就可以了 现在开始测试参数 第一次 startRow : 开始查找数据的第一行。不管startRow的值是多少&#xff…

3D Matching:实现halcon中的find_surface_model

halcon中的三维匹配大致分为两类&#xff0c;一类是基于形状的(Shape-Based)&#xff0c;一类是基于表面的(Surface-Based)。基于形状的匹配可用于单个2D图像中定位复杂的3D物体&#xff0c;3D物体模型必须是CAD模型&#xff0c;且几何边缘清晰可见&#xff0c;使用的相机也要预…

2024年能源环境、材料科学与人工智能国际会议(ICEEMSAI2024)

2024年能源环境、材料科学与人工智能国际会议(ICEEMSAI2024) 会议简介 2024国际能源环境、材料科学和人工智能大会&#xff08;ICEEMSAI 2024&#xff09;主要围绕能源环境、物质科学和人工智慧等研究领域&#xff0c;旨在吸引能源环境、先进材料和人工智能专家学者、科技人员…

虹科Pico汽车示波器 | 免拆诊断案例 | 2011款东风悦达起亚K5车发动机偶尔起动困难

一、故障现象 一辆2011款东风悦达起亚K5车&#xff0c;搭载G4KD发动机&#xff0c;累计行驶里程约为24.5万km。车主反映&#xff0c;第1次起动发动机时偶尔无法起动着机&#xff0c;第2次能够正常起动着机&#xff0c;但发动机故障灯异常点亮。为此在其他维修厂维修过&#xf…

【今日刷题】LeetCode 199.二叉树的右视图(中等)

今日刷题&#xff1a;LeetCode 199.二叉树的右视图&#xff08;中等&#xff09; 题目描述&#xff1a; 给定一个二叉树的 根节点 root&#xff0c;想象自己站在它的右侧&#xff0c;按照从顶部到底部的顺序&#xff0c;返回从右侧所能看到的节点值。 示例 1: 输入: [1,2,3,…

取证——流量分析2

计算流量包文件的SHA256值是&#xff1f;[答案&#xff1a;字母小写][★☆☆☆☆] 4db1c8f3bfa8e29f294f8581e8cccad6f5b3012387d53ef844f2de6fb9ef1fd6 流量包长度在“640-1279”之间的的数据包总共有多少&#xff1f;[答案&#xff1a;100][★☆☆☆☆] frame.len > 640…

智能时代中的工业应用中前所未有的灵活桥接和I/O扩展功能解决方案MachXO2系列LCMXO2-1200HC-4TG100I FPGA可编程逻辑IC

lattice莱迪斯 MachXO2系列LCMXO2-1200HC-4TG100I超低密度FPGA现场可编程门阵列&#xff0c;适用于低成本的复杂系统控制和视频接口设计开发&#xff0c;满足了通信、计算、工业、消费电子和医疗市场所需的系统控制和接口应用。 瞬时启动&#xff0c;迅速实现控制——启动时间…

23、区间和

区间和 题目描述 假定有一个无限长的数轴&#xff0c;数轴上每个坐标上的数都是0。 现在&#xff0c;我们首先进行 n 次操作&#xff0c;每次操作将某一位置x上的数加c。 接下来&#xff0c;进行 m 次询问&#xff0c;每个询问包含两个整数l和r&#xff0c;你需要求出在区间…

02-结构化程式与自定义函数

视频教程&#xff1a;b站视频【MATLAB教程_台大郭彦甫&#xff08;14课&#xff09;原视频补档】https://www.bilibili.com/video/BV1GJ41137UH/?share_sourcecopy_web&vd_sourc*ed6b9f96888e9c85118cb40c164875dfc 官网教程&#xff1a; MATLAB 快速入门 - MathWorks 中…

Java面试题戏剧

目录 第一幕 、第一场&#xff09;某大厦楼下大门前第二场&#xff09;电梯中第三场&#xff09;走廊中 第二幕、第一场&#xff09;公司前台第二场&#xff09;公司卫生间 第三幕、第一场&#xff09;一场异常面试 第四幕 、第一场&#xff09;大厦楼下门口第二场&#xff09;…

InternVideo2重塑视频理解新标杆,多模态学习引领行业风向

引言&#xff1a;视频理解的新篇章——InternVideo2的介绍 随着视频内容在日常生活中的普及&#xff0c;视频理解技术的重要性日益凸显。视频不仅包含丰富的视觉信息&#xff0c;还蕴含着动态变化和多模态元素&#xff0c;如音频和文本。这些特性使得视频成为一个复杂的数据类型…

【Python】科研代码学习:十七 模型参数合并,safetensors / bin

【Python】科研代码学习&#xff1a;十七 模型参数合并&#xff0c;safetensors / bin 前言解决代码知识点&#xff1a;safetensors 和 bin 的区别&#xff1f;知识点&#xff1a;save_pretrained 还会新增的文件知识点&#xff1a;在保存模型参数时&#xff0c;大小发生了成倍…

【Linux的进程篇章 - 进程终止和进程等待的理解】

Linux学习笔记---008 Linux之fork函数、进程终止和等待的理解1、fork函数1.1、什么是fork?1.2、fork的功能介绍1.3、fork函数返回值的理解1.4、fork函数的总结 2、进程的终止2.1、终止是在做什么&#xff1f;2.2、进程终止的3种情况 3、进程的终止3.1、进程终止的三种情况3.2、…