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

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 21save_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 mainimg_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_pathcreateFile(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.mzph.cn/pingmian/179.shtml

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

相关文章

《七》布局QLayout类

QLayout简介 QLayout是由具体类 QBoxLayout、QGridLayout、QFormLayout 和 QStackedLayout继承的抽象基类。 对于 QLayout子类或 QMainWindow的用户&#xff0c;很少需要使用 QLayout 提供的基本功能&#xff0c;例如 setSizeConstraint() 或 setMenuBar()。Qt 布局系统提供了…

程序员购车指南

哈喽大家好&#xff0c;我是咸鱼。 爱车可以说是大部分男人的天性&#xff0c;而我对汽车的热情却远不及对手表的钟爱&#xff08;痴迷劳力士&#xff09;。以至于我的朋友掏出车钥匙指着上面的苹果树标志跟我介绍奔驰 AMG 系列的强劲性能和马力时&#xff0c;我只能尽量假装自…

【三维Dvhop定位】基于麻雀搜索算法的多通信半径和跳距加权的三维Dvhop定位算法【Matlab代码#81】

文章目录 【可更换其他算法&#xff0c;获取资源请见文章第6节&#xff1a;资源获取】1. Dvhop定位算法2. 麻雀搜索算法3. 多通信半径和跳距加权策略3.1 多通信半径策略3.2 跳距加权策略 4. 部分代码展示5. 仿真结果展示6. 资源获取 【可更换其他算法&#xff0c;获取资源请见文…

Oracle-TDE数据加密功能

1 Oracle TDE 1.1 TDE介绍 Oracle TDE是数据库层对存储的用户敏感数据进行的静态加密&#xff0c;加密数据满足主流的安全法规&#xff08;如 PCI DSS&#xff09;相关的加密要求&#xff0c;可以防止数据文件被其他非数据库读取方式访问的情况下(如通过工具直接打开读取数据文…

Java程序生成可执行的exe文件 详细图文教程

1.Java编辑器&#xff0c;如&#xff1a;idea、eclipse等&#xff0c;下载地址&#xff1a;IntelliJ IDEA: The Capable & Ergonomic Java IDE by JetBrainshttps://www.jetbrains.com/idea/2.exe4j&#xff0c;下载地址&#xff1a;ej-technologies - Java APM, Java Prof…

ansible-tower连接git实现简单执行playbook

前提&#xff1a;安装好ansible-tower和git&#xff0c;其中git存放ansible得剧本 其中git中得内容为&#xff1a; --- - name: yjxtesthosts: yinremote_user: rootgather_facts: noroles:- testroles/test/tasks/main.yml #文件内容 --- #- name: Perform Test Task # tas…

ant-design-vue Table+Form表单实现表格内置表单验证,可自定义验证规则,触发必填项

代码示例如下&#xff1a; <!-- --> <template><a-button type"primary" style"padding-left: 10px; padding-right: 10px" click"handleAddRow"><template #icon><plus-outlined /></template>新增</…

2024年大唐杯官网模拟题

单选(出题角度很奇怪&#xff0c;不用太纠结&#xff09; 5G NR系统中&#xff0c;基于SSB的NR同频测量在measconfig里最多可以配置&#xff08; &#xff09;个SMTC窗口。 A、3 B、4 C、1 D、2 答案&#xff1a;D 2个 只在官网找到了这张PPT 5G 中从BBU到AAU需要保证&#x…

Python分析之3 种空间插值方法

插值是一个非常常见的数学概念,不仅数据科学家使用它,而且各个领域的人们也使用它。然而,在处理地理空间数据时,插值变得更加复杂,因为您需要基于几个通常稀疏的观测值创建代表性网格。 在深入研究地理空间部分之前,让我们简要回顾一下线性插值。 为了演示的目的,我将使…

Spring Security详细学习第一篇

Spring Security 前言Spring Security入门编辑Spring Security底层原理UserDetailsService接口PasswordEncoder接口 认证登录校验密码加密存储退出登录 前言 本文是作者学习三更老师的Spring Security课程所记录的学习心得和笔记知识&#xff0c;希望能帮助到大家 Spring Sec…

使用Java调用音乐开放API,并进行播放

使用Java调用音乐开放API&#xff0c;并进行播放 背景描述 电脑没有下载音乐软件&#xff0c;使用网页播放又不太方便&#xff0c;所有就想着使用Java语言直接调用音乐开放API&#xff0c;然后进行播放音乐。 具体代码如下&#xff0c;包含了注释 package com.lowkey.comple…

吴恩达<用于LLM应用程序开发的LangChain> L1-Model_prompt_parser

问题预览/关键词 课程地址如何获取openAI的API Key如何根据日期设置不同模型?如何调用OpenAI的API?如何使用OpenAI的API&#xff1f;langchain如何抽象OpenAI的API接口&#xff1f;langchain如何创建提示词模板并查看模板内容&#xff1f;langchain如何使用提示词模板生成提…

Redis中的BigKey

Redis中的BigKey 文章目录 Redis中的BigKey什么是BigKey&#xff1f;BigKey的危害找到Bigkey删除BigKey优化BigKeyBigKey对持久化的影响对AOF日志的影响对AOF重写和RDB的影响 什么是BigKey&#xff1f; 大 key 并不是指 key 的值很大&#xff0c;而是 key 对应的 value 很大。…

2024华中杯A题完整1-3问py代码+完整思路16页+后续参考论文

A题太阳能路灯光伏板朝向问题 &#xff08;完整版资料文末获取&#xff09; 第1小问&#xff1a;计算每月15日的太阳直射强度和总能量 1. 理解太阳直射辐射和光伏板的关系**&#xff1a;光伏板接收太阳辐射并转化为电能&#xff0c;直射辐射对光伏板的效率影响最大。 2. 收集…

[Vision Board创客营]学习片上Flash移植FAL

文章目录 [Vision Board创客营]学习片上Flash移植FAL介绍环境搭建使用组件测试porbeerasewriteread 结语 [Vision Board创客营]学习片上Flash移植FAL 水平较菜&#xff0c;大佬轻喷。&#x1f630;&#x1f630;&#x1f630; 介绍 &#x1f680;&#x1f680;Vision-Board 开…

Leetcode算法训练日记 | day29

一、递增子序列 1.题目 Leetcode&#xff1a;第 491 题 给你一个整数数组 nums &#xff0c;找出并返回所有该数组中不同的递增子序列&#xff0c;递增子序列中 至少有两个元素 。你可以按 任意顺序 返回答案。 数组中可能含有重复元素&#xff0c;如出现两个整数相等&…

“低价竞争”仍在继续,分期免息成商家新武器

近日&#xff0c;在京东618商家生态伙伴大会上&#xff0c;京东推出各项政策&#xff0c;尽全力让所有合作伙伴赢在京东618、赢在京东。京东金融也将在618大促期间&#xff0c;为各位商家带来极具竞争力的金融产品和大促政策。 举例来说&#xff0c;大促期间&#xff0c;“京东…

基于SSM+Jsp+Mysql的文物管理系统

开发语言&#xff1a;Java框架&#xff1a;ssm技术&#xff1a;JSPJDK版本&#xff1a;JDK1.8服务器&#xff1a;tomcat7数据库&#xff1a;mysql 5.7&#xff08;一定要5.7版本&#xff09;数据库工具&#xff1a;Navicat11开发软件&#xff1a;eclipse/myeclipse/ideaMaven包…

js高级 笔记02

目录 01 object提供的一些静态方法 02 词法作用域 03 作用域链 04 arguments的使用 05 开启严格模式 06 高阶函数 07 闭包 01 object提供的一些静态方法 Object.create() 对象继承 Object.assign(对象1,对象2) 对象合并 可以将对象2 里面的可枚举属性和自身的属性合并到…

Matlab r2023b Simulink 给子系统添加封面

写这篇记录的原因是&#xff0c;r2023b版本里改动了自定义封面的界面&#xff0c;而我是一个新手小白&#xff0c;零基础&#xff0c;探索一天之后发现实现方法。最终效果如图&#xff1a; 步骤1&#xff1a;打开软件&#xff0c;点击Simulink&#xff0c;再打开含有子系统的工…