个人全栈程序员的博客网站，分享网站开发设计技术文章，以及网站开发日志等
普通变量#include <iostream> using namespace std; void swap(int &x, int &y) { //引用传递，可以理解为a就是x，x就是a，只不过名字不一样 cout << "函数内-start" << endl; cout << "&x:" << &x << " &y:" << &y << endl; cout << "x:" << x << " y:" << y << endl; cout << "开始交换" << endl; int tmp; tmp = x; x = y; y = tmp; cout << "&x:" << &x << " &y:" << &y << endl; cout << "x:" << x << " y:" << y << endl; cout << "函数内-end" << endl; } int main() { int a = 2, b = 3; cout << "before a:" << a << " b:" << b << endl; cout << "before &a:" << &a << " &b:" << &b << endl; swap(a, b); cout << "later a:" << a << " b:" << b << endl; cout << "later &a:" << &a << " &b:" << &b << endl; return 0; }结果before a:2 b:3 before &a:0x61fe1c &b:0x61fe18 函数内-start &x:0x61fe1c &y:0x61fe18 x:2 y:3 开始交换 &x:0x61fe1c &y:0x61fe18 x:3 y:2 函数内-end later a:3 b:2 later &a:0x61fe1c &b:0x61fe18指针变量#include <iostream> using namespace std; void swap(int *&x, int *&y) { cout << "函数内-start" << endl; cout << "&x:" << &x << " &y:" << &y << endl; cout << "x:" << x << " y:" << y << endl; cout << "开始交换" << endl; int *tmp;//x，y类型是int* tmp = x; x = y; y = tmp; cout << "&x:" << &x << " &y:" << &y << endl; cout << "x:" << x << " y:" << y << endl; cout << "函数内-end" << endl; cout<<endl; } int main() { int a = 2, b = 3; int *p=&a,*q=&b; cout << "before a:" << a << " b:" << b << endl; cout << "before &a:" << &a << " &b:" << &b << endl; cout << "before *p:" << *p << " &p:" << &p<<" p:"<<p<< endl; cout << "before *q:" << *q << " &q:" << &q<<" q:"<<q << endl; cout<<endl; swap(p, q); cout << "later a:" << a << " b:" << b << endl; cout << "later &a:" << &a << " &b:" << &b << endl; cout << "before *p:" << *p << " &p:" << &p<<" p:"<<p<< endl; cout << "before *q:" << *q << " &q:" << &q<<" q:"<<q << endl; return 0; }结果：before a:2 b:3 before &a:0x61fe1c &b:0x61fe18 before *p:2 &p:0x61fe10 p:0x61fe1c before *q:3 &q:0x61fe08 q:0x61fe18 函数内-start &x:0x61fe10 &y:0x61fe08 x:0x61fe1c y:0x61fe18 开始交换 &x:0x61fe10 &y:0x61fe08 x:0x61fe18 y:0x61fe1c 函数内-end later a:2 b:3 later &a:0x61fe1c &b:0x61fe18 before *p:3 &p:0x61fe10 p:0x61fe18 before *q:2 &q:0x61fe08 q:0x61fe1c指针型变量的引用相当于C语言中的二级指针#include <cstdio> void f1(int **b) { printf("函数-start\n"); printf("**b=%d,*b=%#X,*&b=%#X,&*b=%#X\n", **b,*b,*&b,&*b); printf("&b=%#X,b=%#X\n",&b,b); int p=2; printf("p=%d,&p=%#X\n", p,&p); int *q=&p; printf("*q=%d,q=%#X,&q=%#X\n", *q,q,&q); *b=q; printf("*b=q;\n"); printf("**b=%d,*b=%#X,*&b=%#X,&*b=%#X\n", **b,*b,*&b,&*b); printf("&b=%#X,b=%#X\n",&b,b); printf("函数-end\n"); } int main() { int a=1; int *s=&a; printf("a=%d,&a=%#X\n", a,&a); printf("*s=%d,&s=%#X,s=%#X\n", *s,&s,s); f1(&s); printf("*s=%d,&s=%#X,s=%#X\n", *s,&s,s); printf("a=%d,&a=%#X\n", a,&a); return 0; }结果：a=1,&a=0X61FE1C *s=1,&s=0X61FE10,s=0X61FE1C 函数-start **b=1,*b=0X61FE1C,*&b=0X61FE10,&*b=0X61FE10 &b=0X61FDF0,b=0X61FE10 p=2,&p=0X61FDDC *q=2,q=0X61FDDC,&q=0X61FDD0 *b=q; **b=2,*b=0X61FDD4,*&b=0X61FE10,&*b=0X61FE10 &b=0X61FDF0,b=0X61FE10 函数-end *s=2,&s=0X61FE10,s=0X61FDD4 a=1,&a=0X61FE1C参考：https://blog.csdn.net/qq_34243930/article/details/81638852 https://www.cnblogs.com/codingmengmeng/p/5865510.html
值传递和引用传递” 按值传递 “中包括值传递（实实在在的值啊！）和指针传递（指针传递参数本质上是值传递的方式，它所传递的是一个地址值），传递的都是实参的一个拷贝。#include <iostream> using namespace std; void swap(int x, int y) { int tmp; tmp = x; x = y; y = tmp; } int main() { int a = 2, b = 3; printf("before:%d,%d\n", a, b); swap(a, b); printf("later:%d,%d\n", a, b); return 0; }结果：before:2,3 later:2,3下面的例子体现了不论传递的是值还是指针 (指针也是一个值)，传递给被调用函数的都是实参的一个拷贝，直接对拷贝进行操作不会影响实参#include <iostream> using namespace std; void swap(int *x, int *y) { cout<<"函数内-start"<<endl; cout<<"*x:"<<*x<<" *y:"<<*y<<endl; cout<<"&x:"<<&x<<" &y:"<<&y<<endl; cout<<"x:"<<x<<" y:"<<y<<endl; cout<<"开始交换"<<endl; int *temp= NULL; //因为x，y的类型都是int * temp= x; //temp= &a &a:0x61fe1c &b:0x61fe18 x = y; // &a= &b y = temp; //&b=temp //所以交换x，y只是交换了两者存储的值(值为&a,&b)，并没有涉及到主函数a,b值的交换 //所以只是操作地址并没有卵用 cout<<"*x:"<<*x<<" *y:"<<*y<<endl; cout<<"&x:"<<&x<<" &y:"<<&y<<endl; cout<<"x:"<<x<<" y:"<<y<<endl; cout<<"函数内-end"<<endl; } int main() { int a = 2, b = 3; cout<<"before a:"<<a<<" b:"<<b<<endl; cout << "before &a:" << &a << " &b:" << &b << endl; swap(&a, &b); cout<<"later a:"<<a<<" b:"<<b<<endl; cout << "later &a:" << &a << " &b:" << &b << endl; return 0; }结果before a:2 b:3 before &a:0x61fe1c &b:0x61fe18 函数内-start *x:2 *y:3 //0x61fe1c->2,0x61fe18->3 &x:0x61fdf0 &y:0x61fdf8 x:0x61fe1c y:0x61fe18 开始交换 *x:3 *y:2 //0x61fe1c->2,0x61fe18->3 &x:0x61fdf0 &y:0x61fdf8 x:0x61fe18 y:0x61fe1c 函数内-end later a:2 b:3 later &a:0x61fe1c &b:0x61fe18#include <iostream> using namespace std; void swap(int *x, int *y) { cout<<"函数内-start"<<endl; cout<<"*x:"<<*x<<" *y:"<<*y<<endl; cout<<"&x:"<<&x<<" &y:"<<&y<<endl; cout<<"x:"<<x<<" y:"<<y<<endl; cout<<"开始交换"<<endl; int temp; //*x作用就是：取指针x的值(&a)，再把这个值作为地址，再取这个地址的值！相当于*(&a)=a temp= *x; //temp=a *x = *y; //a=b *y = temp; //b=temp cout<<"*x:"<<*x<<" *y:"<<*y<<endl; cout<<"&x:"<<&x<<" &y:"<<&y<<endl; cout<<"x:"<<x<<" y:"<<y<<endl; cout<<"函数内-end"<<endl; } int main() { int a = 2, b = 3; cout<<"before a:"<<a<<" b:"<<b<<endl; cout<<"before &a:"<<&a<<" &b:"<<&b<<endl; swap(&a, &b); cout<<"later a:"<<a<<" b:"<<b<<endl; cout<<"later &a:"<<&a<<" &b:"<<&b<<endl; return 0; }结果：before a:2 b:3 before &a:0x61fe1c &b:0x61fe18 函数内-start *x:2 *y:3 &x:0x61fdf0 &y:0x61fdf8 x:0x61fe1c y:0x61fe18 开始交换 *x:3 *y:2 &x:0x61fdf0 &y:0x61fdf8 x:0x61fe1c y:0x61fe18 函数内-end later a:3 b:2 later &a:0x61fe1c &b:0x61fe18
Typecho后台设置永久链接后，会在域名后加上index.php，很多人都接受不了。例如如下网址：http://qqdie.com/index.php/archives/37/，但我们希望最终的形式是这样：http://qqdie.com/archives/37.html。那么我们如何做到这样的效果？1.配置服务器的rewrite规则如果在保存上述配置的时候，typecho无法自动配置，那么你可能需要手动配置服务器的rewrite规则。Linux Apache 环境 (.htaccess)：<IfModule mod_rewrite.c> RewriteEngine On # 下面是在根目录，文件夹要修改路径 RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php/$1 [L] </IfModule>Linux Apache 环境（Nginx）：location / { index index.html index.php; if (-f $request_filename/index.html) { rewrite (.*) $1/index.html break; } if (-f $request_filename/index.php) { rewrite (.*) $1/index.php; } if (!-f $request_filename) { rewrite (.*) /index.php; } }Windows IIS 伪静态 (httpd.ini)：[ISAPI_Rewrite] # 3600 = 1 hour CacheClockRate 3600 RepeatLimit 32 # 中文tag解决 RewriteRule /tag/(.*) /index\.php\?tag=$1 # sitemapxml RewriteRule /sitemap.xml /sitemap.xml [L] RewriteRule /favicon.ico /favicon.ico [L] # 内容页 RewriteRule /(.*).html /index.php/$1.html [L] # 评论 RewriteRule /(.*)/comment /index.php/$1/comment [L] # 分类页 RewriteRule /category/(.*) /index.php/category/$1 [L] # 分页 RewriteRule /page/(.*) /index.php/page/$1 [L] # 搜索页 RewriteRule /search/(.*) /index.php/search/$1 [L] # feed RewriteRule /feed/(.*) /index.php/feed/$1 [L] # 日期归档 RewriteRule /2(.*) /index.php/2$1 [L] # 上传图片等 RewriteRule /action(.*) /index.php/action$1 [L]nginx 配置server { listen 80; server_name yourdomain.com; root /home/yourdomain/www/; index index.html index.htm index.php; if (!-e $request_filename) { rewrite ^(.*)$ /index.php$1 last; } location ~ .*\.php(\/.*)*$ { include fastcgi.conf; fastcgi_pass 127.0.0.1:9000; } access_log logs/yourdomain.log combined; }apache 配置<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1] </IfModule>2.后台配置typecho伪静态在typecho后台，开启伪静态，并选择你喜好的url形式即可。本文来源：https://qqdie.com/archives/typecho-open-pseudo-static-get-rid-of-that-pesky-index-the-php.html
HTML5靠谱教程合集，HTML5+CSS+JS全方面解析，附上节课回顾word文档帮助记忆，最新最全的HTML5教程传送门:点我 ps:图片未经压缩，网络不通畅可能加载比较慢，请耐心等待一会！
QT5入门精讲系列（来自于吴健老师）（ps：一个很精彩的QT入门教程！）传送门:点我非常好的从c++过渡到Qt的入门视频，对Qt的大部分基础元素有着非常通俗、全面的讲解。基础篇 案例篇计算器 管理系统 打地鼠 Qt常用快捷键
先上效果图上代码：from pyspider.libs.base_handler import * import pymongo class Handler(BaseHandler): crawl_config = { } client = pymongo.MongoClient('localhost') db = client['TripAdvise'] @every(minutes=24 * 60) def on_start(self): self.crawl('https://www.tripadvisor.cn/Attractions-g186338-Activities-c47-London_England.html',callback=self.index_page, validate_cert=False) @config(age=10 * 24 * 60 * 60) def index_page(self, response): for each in response.doc('div.listing_title > a').items(): self.crawl(each.attr.href, callback=self.detail_page, validate_cert=False) # 翻页 next = response.doc('.pagination .nav.next').attr.href self.crawl(next, callback=self.index_page, validate_cert=False) @config(priority=2) def detail_page(self, response): url = response.url name = response.doc('.h1').text() rating = response.doc(' div.ratingContainer > a > span').text() garde = response.doc('div.section.rating > span').text() address = response.doc('.contactInfo > .address').text() phone = response.doc('div.contact > div.contactType.phone.is-hidden-mobile > div').text() opening = response.doc('div.prw_rup.prw_common_atf_header_bl_responsive.headerBL > div > span').text() introduction = response.doc('.centerWell > div > div > div > div > div > span').text() return { "url": url, "name": name, "rating": rating, 'garde': garde, "address": address, "phone": phone, "opening": opening, "introduction": introduction } def on_result(self, result): if result: self.save_to_mongo(result) def save_to_mongo(self, result): if self.db['london'].insert(result): print('保存到MongoDB成功', result)参考：https://cuiqingcai.com/8317.html
先奉上代码：# 如果使用PhantomJS则selenium版本只能2.48.0及以下 from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC import time import re from pyquery import PyQuery as py import pymongo MONGO_URL='localhost' MONGO_DB='taobao' MONGO_TABLE='product' SERVICE_ARGS=['--load-images=false','--disk-cache=true'] # 不加载图片，开启缓存 client = pymongo.MongoClient(MONGO_URL, connect=False) db=client[MONGO_DB] # browser = webdriver.Chrome() browser = webdriver.PhantomJS(service_args=SERVICE_ARGS) browser.set_window_size(1400,900) #设置窗口大小，防止元素位置改变 wait = WebDriverWait(browser, 15) def search(): # 执行搜索后跳转到登录界面--选择微博登录-（淘宝要绑定微博，微博登录要取消双重登录验证） try: browser.get("https://www.taobao.com/") print('正在搜索') input = wait.until( EC.presence_of_element_located((By.CSS_SELECTOR, "#q")) ) # 输入框 submit = wait.until( EC.element_to_be_clickable((By.CSS_SELECTOR, "#J_TSearchForm > div.search-button > button")) ) # 搜索按钮 input.send_keys('美食') time.sleep(1) submit.click() # 登录 print('正在登录') wait.until( EC.element_to_be_clickable((By.CSS_SELECTOR, "#J_Quick2Static")) ).click() # 点击密码登录 time.sleep(2) wait.until( EC.element_to_be_clickable((By.CSS_SELECTOR, "#J_OtherLogin > a.weibo-login")) ).click() # 选择微博登录 wait.until( EC.presence_of_element_located((By.CSS_SELECTOR, "#pl_login_logged > div > div:nth-child(2) > div > input")) ).send_keys(' ') # 输入账号 time.sleep(2) wait.until( EC.presence_of_element_located((By.CSS_SELECTOR, "#pl_login_logged > div > div:nth-child(3) > div > input")) ).send_keys(' ') # 输入密码 time.sleep(2) wait.until( EC.element_to_be_clickable( (By.CSS_SELECTOR, "#pl_login_logged > div > div:nth-child(7) > div:nth-child(1) > a > span")) ).click() # 点击登录按钮 time.sleep(5) total = wait.until( EC.presence_of_element_located((By.CSS_SELECTOR, "#mainsrp-pager > div > div > div > div.total")) ) print('登录成功') get_prodects() return total.text except TimeoutError: search() # 翻页 def next_page(page_number): print('正在翻到第'+str(page_number)+'页') try: input = wait.until( EC.presence_of_element_located((By.CSS_SELECTOR, "#mainsrp-pager > div > div > div > div.form > input")) ) # 输入页数 submit = wait.until( EC.element_to_be_clickable((By.CSS_SELECTOR, "#mainsrp-pager > div > div > div > div.form > span.btn.J_Submit")) ) # 确定按钮 input.clear() input.send_keys(page_number) time.sleep(2) submit.click() wait.until( # 判断元素中是否存在指定的文本 判断当前高亮页码的序号是否是page_number li.item.active EC.text_to_be_present_in_element((By.CSS_SELECTOR,'#mainsrp-pager > div > div > div > ul > li.item.active > span'),str(page_number)) ) get_prodects() except TimeoutError: next_page(page_number) # 提取数据 def get_prodects(): print('正在提取数据') wait.until( EC.presence_of_element_located((By.CSS_SELECTOR,'#mainsrp-itemlist .items .item')) ) html=browser.page_source # 获取网页源代码 doc=py(html) items=doc('#mainsrp-itemlist .items .item').items() for item in items: product={ 'image':item.find('.pic .img').attr('src'), 'price':item.find('.price').text(), 'deal':item.find('.deal-cnt').text()[:-3], 'title':item.find('.title').text(), 'shop':item.find('.shop').text(), 'location':item.find('.location').text() } # print(product) save_to_mongo(product) def save_to_mongo(result): try: if db[MONGO_TABLE].insert(result): print("存储到MongoDB成功", result) except Exception: print("存储到MongoDB失败", result) def main(): total=search() total=int(re.compile('(\d+)').search(total).group(1)) # 把str强转为int # print(total) for i in range(2,total+1): next_page(i) browser.close() if __name__ == '__main__': main() 结果如下："C:\Program Files\Python\Python38\python.exe" E:/PycharmProjects/test/爬虫/淘宝美食/TaoBaoSpider.py 正在搜索 正在登录 登录成功 正在提取数据 E:/PycharmProjects/test/爬虫/淘宝美食/TaoBaoSpider.py:117: DeprecationWarning: insert is deprecated. Use insert_one or insert_many instead. if db[MONGO_TABLE].insert(result): 存储到MongoDB成功 {'image': '//g-search1.alicdn.com/img/bao/uploaded/i4/imgextra/i3/211060109/O1CN01g5A8VZ1Cfxk1wE0a8_!!0-saturn_solar.jpg_230x230.jpg', 'price': '¥59.80', 'deal': '6000+', 'title': '山东特产酱牛肉卤牛肉熟食五香真空480g健身牛肉牛腱肉即食小包装', 'shop': '日彤旗舰店', 'location': '山东 青岛', '_id': ObjectId('5e65b817070577c77949f239')} 存储到MongoDB成功 {'image': '//g-search1.alicdn.com/img/bao/uploaded/i4/i1/1690440456/O1CN01LNTXpC1FEtBiIC6yB_!!0-item_pic.jpg_230x230.jpg', 'price': '¥44.80', 'deal': '3.5万+', 'title': '友臣正宗肉松饼整箱休闲早零食充饥夜宵特产糕点美食营养食品面包', 'shop': '友臣旗舰店', 'location': '福建 泉州', '_id': ObjectId('5e65b817070577c77949f23a')} 存储到MongoDB成功 {'image': '//g-search3.alicdn.com/img/bao/uploaded/i4/i2/475325704/O1CN01SoS4Ez1s0TkMD1y5E_!!0-item_pic.jpg_230x230.jpg', 'price': '¥10.90', 'deal': '7.5万+', 'title': '知味观艾草青团网红美食咸蛋黄肉松糯米团子杭州特产糕点小吃零食', 'shop': '知味观官方旗舰店', 'location': '浙江 杭州', '_id': ObjectId('5e65b817070577c77949f23b')} 存储到MongoDB成功 {'image': '//g-search3.alicdn.com/img/bao/uploaded/i4/i3/2780349775/O1CN01fdbBay2M507ViTO7T_!!0-item_pic.jpg_230x230.jpg', 'price': '¥19.90', 'deal': '781', 'title': '安徽特产正宗黄山烧饼60个梅干菜扣肉饼手工美食小吃零食糕点', 'shop': '徽味和旗舰店', 'location': '安徽 黄山', '_id': ObjectId('5e65b818070577c77949f23c')} 存储到MongoDB成功 {'image': '//g-search2.alicdn.com/img/bao/uploaded/i4/i1/2901136168/O1CN01ONmRqA1vQzVLiJB2S_!!0-item_pic.jpg_230x230.jpg', 'price': '¥171.00', 'deal': '4178', 'title': '美珍香迷你金钱烧烤猪肉200g+迷你休闲烧烤猪肉200g小吃零食美食', 'shop': '美珍香旗舰店', 'location': '上海', '_id': ObjectId('5e65b818070577c77949f23d')} 存储到MongoDB成功 {'image': '//g-search2.alicdn.com/img/bao/uploaded/i4/i1/725677994/O1CN01C9jVrG28vIjnT4bsM_!!725677994-0-sm.jpg_230x230.jpg', 'price': '¥125.00', 'deal': '4115', 'title': '科尔沁手撕风干牛肉干400g原味内蒙古特产牛肉干美食零食小吃', 'shop': '天猫超市', 'location': '上海', '_id': ObjectId('5e65b818070577c77949f23e')} 存储到MongoDB成功 {'image': '//g-search3.alicdn.com/img/bao/uploaded/i4/i2/2780349775/O1CN01blLMR12M506FU8JES_!!0-item_pic.jpg_230x230.jpg', 'price': '¥19.90', 'deal': '1192', 'title': '咸海鸭蛋黄酥雪媚娘12枚早餐面包网红美食糕点心零食小吃休闲食品', 'shop': '徽味和旗舰店', 'location': '安徽 黄山', '_id': ObjectId('5e65b818070577c77949f23f')} 存储到MongoDB成功 {'image': '//g-search3.alicdn.com/img/bao/uploaded/i4/i3/3282604381/O1CN01X6NZOS1iEXkd6R3wY_!!0-item_pic.jpg_230x230.jpg', 'price': '¥89.00', 'deal': '1.0万+', 'title': '轩妈家蛋黄酥2盒 红豆味雪媚娘麻薯新鲜糕点美食网红零食小吃早餐', 'shop': '轩妈食品旗舰店', 'location': '广西 南宁', '_id': ObjectId('5e65b818070577c77949f240')} 存储到MongoDB成功 {'image': '//g-search3.alicdn.com/img/bao/uploaded/i4/i3/3282604381/O1CN01d3TQvV1iEXjene2EF_!!0-item_pic.jpg_230x230.jpg', 'price': '¥65.80', 'deal': '2.5万+', 'title': '轩妈家蛋黄酥4种口味组合混合装糕点点心美食零食小吃早餐食品', 'shop': '轩妈食品旗舰店', 'location': '广西 南宁', '_id': ObjectId('5e65b818070577c77949f241')} 存储到MongoDB成功 {'image': '//g-search1.alicdn.com/img/bao/uploaded/i4/i2/628189716/O1CN0118GTCN2LdylCslxQ3_!!0-item_pic.jpg_230x230.jpg', 'price': '¥38.90', 'deal': '1.5万+', 'title': '【百草味-肉松饼1kg】网红休闲零食特色小吃美食点心传统', 'shop': '百草味旗舰店', 'location': '浙江 杭州', '_id': ObjectId('5e65b818070577c77949f242')} 存储到MongoDB成功 {'image': '//g-search2.alicdn.com/img/bao/uploaded/i4/i3/725677994/O1CN01T834nB28vIjlZDD1k_!!725677994-0-sm.jpg_230x230.jpg', 'price': '¥59.90', 'deal': '2561', 'title': '好丽友薯愿5连包休闲膨化薯片礼包新老包装饼干美食小吃随机发货', 'shop': '天猫超市', 'location': '上海', '_id': ObjectId('5e65b818070577c77949f243')} 存储到MongoDB成功 {'image': '//g-search2.alicdn.com/img/bao/uploaded/i4/i4/3017400344/O1CN01MXwZHa1EPapinEAtp_!!0-item_pic.jpg_230x230.jpg', 'price': '¥64.50', 'deal': '6.0万+', 'title': '好欢螺螺蛳粉柳州特产美食酸辣粉300gx5袋螺狮粉速食方便面米线', 'shop': '好欢螺旗舰店', 'location': '广西 柳州', '_id': ObjectId('5e65b818070577c77949f244')} 存储到MongoDB成功 {'image': None, 'price': '¥29.90', 'deal': '10万+', 'title': '满减【三只松鼠_蜀香牛肉100g】休闲零食小吃肉脯特产牛肉干美食', 'shop': '三只松鼠旗舰店', 'location': '安徽 芜湖', '_id': ObjectId('5e65b818070577c77949f245')} 存储到MongoDB成功 {'image': None, 'price': '¥69.90', 'deal': '1422', 'title': '满299减200丨自贡冷吃牛肉120g肖三婆四川麻辣牛肉干美食真空熟食', 'shop': '肖三婆旗舰店', 'location': '四川 成都', '_id': ObjectId('5e65b818070577c77949f246')} 存储到MongoDB成功 {'image': None, 'price': '¥25.90', 'deal': '6.5万+', 'title': '【良品铺子-猪肉脯200g】零食小吃肉干网红休闲食品美食小包装', 'shop': '良品铺子旗舰店', 'location': '广东 广州', '_id': ObjectId('5e65b818070577c77949f247')} 存储到MongoDB成功 {'image': None, 'price': '¥119.80', 'deal': '1166', 'title': '【周黑鸭旗舰店_锁鲜】气调盒装卤鸭舌150g*2 美食特产零食品小吃', 'shop': '周黑鸭食品旗舰店', 'location': '湖北 武汉', '_id': ObjectId('5e65b818070577c77949f248')} 存储到MongoDB成功 {'image': None, 'price': '¥118.00', 'deal': '2082', 'title': '李村猪肉脂渣香酥油渣干炸五花肉粕青岛特产小吃美食肉类生酮零食', 'shop': '李村旗舰店', 'location': '山东 青岛', '_id': ObjectId('5e65b818070577c77949f249')} 存储到MongoDB成功 {'image': None, 'price': '¥79.00', 'deal': '2060', 'title': '科尔沁超干牛肉干175g原味内蒙古风干牛肉干草原特产手撕零食美食', 'shop': '天猫超市', 'location': '上海', '_id': ObjectId('5e65b818070577c77949f24a')} 存储到MongoDB成功 {'image': None, 'price': '¥74.50', 'deal': '2.0万+', 'title': '好欢螺螺蛳粉柳州美食螺丝粉400g*5袋螺狮粉速食懒人方便面非泡面', 'shop': '好欢螺旗舰店', 'location': '广西 柳州', '_id': ObjectId('5e65b818070577c77949f24b')} 存储到MongoDB成功 {'image': None, 'price': '¥39.90', 'deal': '6000+', 'title': '好丽友呀土豆9连包超值礼包实惠家庭装休闲膨化薯片饼干美食小吃', 'shop': '天猫超市', 'location': '上海', '_id': ObjectId('5e65b818070577c77949f24c')} 存储到MongoDB成功 {'image': None, 'price': '¥288.00', 'deal': '8', 'title': '【周黑鸭门店同款】熹礼礼盒920g 含整鸭 美食特产零食大礼包礼盒', 'shop': '周黑鸭食品旗舰店', 'location': '湖北 武汉', '_id': ObjectId('5e65b818070577c77949f24d')} 存储到MongoDB成功 {'image': None, 'price': '¥73.50', 'deal': '2918', 'title': '友臣肉松饼2.1kg营养早餐点心美食晚上解饿零食糕点整箱批发面包', 'shop': '友臣旗舰店', 'location': '福建 泉州', '_id': ObjectId('5e65b818070577c77949f24e')} 存储到MongoDB成功 {'image': None, 'price': '¥29.80', 'deal': '5.5万+', 'title': '卫龙大礼包辣条亲嘴烧豆干麻辣味整箱儿时小吃休闲美食网红零食品', 'shop': '猫诚旗舰店', 'location': '安徽 合肥', '_id': ObjectId('5e65b818070577c77949f24f')} 存储到MongoDB成功 {'image': None, 'price': '¥36.80', 'deal': '1.5万+', 'title': '蛋黄酥海鸭蛋零食小吃网红充饥夜宵特产美食糕点点心整箱休闲食品', 'shop': '比比赞旗舰店', 'location': '福建 厦门', '_id': ObjectId('5e65b818070577c77949f250')} 存储到MongoDB成功 {'image': None, 'price': '¥69.90', 'deal': '1052', 'title': '满299减200丨肖三婆无骨鸭掌150g麻辣去脱骨鸭爪四川特产卤味美食', 'shop': '肖三婆旗舰店', 'location': '四川 成都', '_id': ObjectId('5e65b818070577c77949f251')} 存储到MongoDB成功 {'image': None, 'price': '¥45.90', 'deal': '1847', 'title': '阿宽白家红油面皮12袋1260g特色小吃方便面非火鸡面成都特色美食', 'shop': '天猫超市', 'location': '上海', '_id': ObjectId('5e65b818070577c77949f252')} 存储到MongoDB成功 {'image': None, 'price': '¥64.90', 'deal': '1099', 'title': '盼盼肉松饼整箱营养早餐糕点小吃面包特产美食网红小零食2100g', 'shop': '盼盼食品官方旗舰店', 'location': '河南 漯河', '_id': ObjectId('5e65b818070577c77949f253')} 存储到MongoDB成功 {'image': None, 'price': '¥189.00', 'deal': '1068', 'title': '散装【卫龙旗舰店】魔芋爽整箱辣条毛肚素食香麻辣网红美食小袋装', 'shop': '卫龙食品旗舰店', 'location': '河南 漯河', '_id': ObjectId('5e65b818070577c77949f254')} 存储到MongoDB成功 {'image': None, 'price': '¥123.00', 'deal': '2597', 'title': '【德州扒鸡旗舰店】德州扒鸡正宗鸡爪熟食零食美食德州 扒鸡600g3', 'shop': '德州扒鸡旗舰店', 'location': '山东 德州', '_id': ObjectId('5e65b818070577c77949f255')} 存储到MongoDB成功 {'image': None, 'price': '¥68.00', 'deal': '222', 'title': '沈大成糕点桂花拉糕2盒 上海特产老字号 糯米糕点心 网红美食', 'shop': '沈大成旗舰店', 'location': '上海', '_id': ObjectId('5e65b818070577c77949f256')} 存储到MongoDB成功 {'image': None, 'price': '¥92.90', 'deal': '1752', 'title': '廖记棒棒鸡无骨鸡爪两份920g 四川特色小吃麻辣无骨鸡爪零食美食', 'shop': '廖记棒棒鸡旗舰店', 'location': '四川 成都', '_id': ObjectId('5e65b818070577c77949f257')} 存储到MongoDB成功 {'image': None, 'price': '¥39.90', 'deal': '5000+', 'title': '嘉华鲜花饼云腿小饼12枚礼袋云南特产零食小吃美食早餐传统糕点心', 'shop': '嘉华食品旗舰店', 'location': '云南 昆明', '_id': ObjectId('5e65b818070577c77949f258')} 存储到MongoDB成功 {'image': None, 'price': '¥19.90', 'deal': '3.5万+', 'title': '【良品铺子-甜辣鸭脖子190g】卤味零食小吃美食休闲食品小包装', 'shop': '良品铺子旗舰店', 'location': '广东 广州', '_id': ObjectId('5e65b818070577c77949f259')} 存储到MongoDB成功 {'image': None, 'price': '¥56.00', 'deal': '2793', 'title': '桂花鸭南京盐水鸭1000g正宗江苏特产年货美食板鸭咸水鸭真空熟食', 'shop': '桂花鸭旗舰店', 'location': '江苏 南京', '_id': ObjectId('5e65b818070577c77949f25a')} 存储到MongoDB成功 {'image': None, 'price': '¥84.90', 'deal': '2052', 'title': '桃李天然酵母面包1800g营养早餐零食美食品手撕口袋面包蛋糕整箱', 'shop': '桃李食品旗舰店', 'location': '辽宁 沈阳', '_id': ObjectId('5e65b818070577c77949f25b')} 存储到MongoDB成功 {'image': None, 'price': '¥69.00', 'deal': '1547', 'title': '杨大爷五花腊肉500g四川美食特产腊肉农家自制烟熏肥咸肉柴火腊肉', 'shop': '杨大爷旗舰店', 'location': '四川 成都', '_id': ObjectId('5e65b818070577c77949f25c')} 存储到MongoDB成功 {'image': None, 'price': '¥20.50', 'deal': '3508', 'title': '满减【三只松鼠_墨玉川式芝麻酥135g】美食早餐小吃点心休闲零食', 'shop': '三只松鼠旗舰店', 'location': '安徽 芜湖', '_id': ObjectId('5e65b818070577c77949f25d')} 存储到MongoDB成功 {'image': None, 'price': '¥69.90', 'deal': '1897', 'title': '双鱼猪肉脯400克靖江特产猪肉铺金奖猪肉干自然片老字号中华美食', 'shop': '双鱼食品旗舰店', 'location': '江苏 泰州', '_id': ObjectId('5e65b818070577c77949f25e')} 存储到MongoDB成功 {'image': None, 'price': '¥109.00', 'deal': '721', 'title': '桂花鸭南京盐水鸭+酱鸭2000g特产正宗美食送礼真空装熟食年货食品', 'shop': '桂花鸭旗舰店', 'location': '江苏 南京', '_id': ObjectId('5e65b818070577c77949f25f')} 存储到MongoDB成功 {'image': None, 'price': '¥29.90', 'deal': '3.0万+', 'title': '绝艺鸭货零食大礼包麻辣味网红小吃休闲食品充饥夜宵整箱散装美食', 'shop': '绝艺食品旗舰店', 'location': '湖南 长沙', '_id': ObjectId('5e65b818070577c77949f260')} 存储到MongoDB成功 {'image': None, 'price': '¥178.00', 'deal': '494', 'title': '修文鸭舌温州特产酱鸭舌酱卤鸭舌头原味美食小吃休闲零食净重480g', 'shop': '修文食品官方旗舰店', 'location': '浙江 温州', '_id': ObjectId('5e65b818070577c77949f261')} 存储到MongoDB成功 {'image': None, 'price': '¥29.90', 'deal': '4604', 'title': '来伊份虎皮蛋糕168gx2糕点零食奶香夹心蛋糕美食早餐软点心小包装', 'shop': '来伊份官方旗舰店', 'location': '上海', '_id': ObjectId('5e65b818070577c77949f262')} 存储到MongoDB成功 {'image': None, 'price': '¥121.00', 'deal': '1112', 'title': '【旗舰店】螺状元柳州螺蛳粉280g*10袋礼盒装特产美食广西螺丝粉', 'shop': '螺状元旗舰店', 'location': '广西 柳州', '_id': ObjectId('5e65b818070577c77949f263')} 存储到MongoDB成功 {'image': None, 'price': '¥36.90', 'deal': '1.0万+', 'title': '沈师傅鸡蛋干四川特产豆腐干成都美食豆干小吃零食休闲食品非150g', 'shop': '沈师傅旗舰店', 'location': '四川 成都', '_id': ObjectId('5e65b818070577c77949f264')} 存储到MongoDB成功 {'image': None, 'price': '¥29.90', 'deal': '1.0万+', 'title': '五芳斋绿豆糕伴手礼桂花糕办公室点心休闲小吃零食绿豆饼好吃美食', 'shop': '五芳斋官方旗舰店', 'location': '浙江 嘉兴', '_id': ObjectId('5e65b818070577c77949f265')} 存储到MongoDB成功 {'image': None, 'price': '¥60.00', 'deal': '1566', 'title': '奇多粟米棒休闲食品小吃零食整箱混装90*12童年回忆怀旧网红美食', 'shop': '百事集团官方旗舰店', 'location': '江苏 无锡', '_id': ObjectId('5e65b818070577c77949f266')} 存储到MongoDB成功 {'image': None, 'price': '¥32.90', 'deal': '5000+', 'title': '稻香村牛舌饼360G*2好吃的传统特产特色糕点心酥皮美食小吃零食', 'shop': '稻香村食品旗舰店', 'location': '北京', '_id': ObjectId('5e65b818070577c77949f267')} 存储到MongoDB成功 {'image': None, 'price': '¥90.00', 'deal': '660', 'title': '美珍香芝士烧烤猪肉200g女生办公室零食网红特产小吃小孩肉类美食', 'shop': '美珍香旗舰店', 'location': '上海', '_id': ObjectId('5e65b818070577c77949f268')} 正在翻到第2页 正在提取数据 存储到MongoDB成功 {'image': '//g-search1.alicdn.com/img/bao/uploaded/i4/imgextra/i2/355210051/O1CN010bqXZy1CFOmnpz1vu_!!0-saturn_solar.jpg_230x230.jpg', 'price': '¥59.00', 'deal': '900', 'title': '王小余外卖料理包盖浇饭煲仔饭快餐方便菜肴包简餐冷冻速食批发', 'shop': '王小余旗舰店', 'location': '湖南 长沙', '_id': ObjectId('5e65b81d070577c77949f269')} 存储到MongoDB成功 {'image': '//g-search1.alicdn.com/img/bao/uploaded/i4/imgextra/i3/31955429/O1CN01DUqXSW1pyWpUevs0i_!!0-saturn_solar.jpg_230x230.jpg', 'price': '¥39.00', 'deal': '1017', 'title': '礼记 杏仁饼 澳门礼记饼家 粒粒澳门手信特产圆罐美食零食410g', 'shop': '澳门礼记饼家旗舰店', 'location': '广东 珠海', '_id': ObjectId('5e65b81d070577c77949f26a')} 存储到MongoDB成功 {'image': '//g-search1.alicdn.com/img/bao/uploaded/i4/imgextra/i4/128920586/TB2AODfqOOYBuNjSsD4XXbSkFXa_!!0-saturn_solar.jpg_230x230.jpg', 'price': '¥45.80', 'deal': '9500+', 'title': '正宗香肠腊肠咸甜味纯肉安徽农家自制灌肠手工土特产风干特色腊味', 'shop': '挑货佬旗舰店', 'location': '安徽 合肥', '_id': ObjectId('5e65b81d070577c77949f26b')} 存储到MongoDB成功 {'image': '//g-search3.alicdn.com/img/bao/uploaded/i4/i1/2112833578/O1CN01vCskFZ1cIli65RWbO_!!0-item_pic.jpg_230x230.jpg', 'price': '¥69.90', 'deal': '705', 'title': '港荣奶香蒸蛋糕点点心 整箱营养早餐零食品美食手撕小吃面包邮', 'shop': '港荣食品旗舰店', 'location': '广东 揭阳', '_id': ObjectId('5e65b81d070577c77949f26c')} 存储到MongoDB成功 {'image': '//g-search3.alicdn.com/img/bao/uploaded/i4/i4/1719214398/O1CN019NyQD71iMKTy0GvDt_!!0-item_pic.jpg_230x230.jpg', 'price': '¥49.00', 'deal': '2395', 'title': '【买二送一】沈大成糕点青芝士团网红零食小吃老字号美食上海特产', 'shop': '沈大成旗舰店', 'location': '上海', '_id': ObjectId('5e65b81d070577c77949f26d')} 存储到MongoDB成功 {'image': '//g-search2.alicdn.com/img/bao/uploaded/i4/i4/2200757237600/O1CN01b7qOBA260qfUahx1r_!!0-item_pic.jpg_230x230.jpg', 'price': '¥99.00', 'deal': '', 'title': '科尔沁手撕风干牛肉干400g原味内蒙古特产牛肉干美食零食小吃', 'shop': '天猫会员店', 'location': '上海', '_id': ObjectId('5e65b81d070577c77949f26e')} 存储到MongoDB成功 {'image': '//g-search3.alicdn.com/img/bao/uploaded/i4/i2/3417098543/O1CN010KZu3a2CykB5pWFhh_!!0-item_pic.jpg_230x230.jpg', 'price': '¥37.90', 'deal': '2.5万+', 'title': '【顺丰快递】柳州螺蛳粉家柳广西特产螺狮美食300g*5包方便酸辣粉', 'shop': '家柳旗舰店', 'location': '广西 柳州', '_id': ObjectId('5e65b81d070577c77949f26f')} 存储到MongoDB成功 {'image': '//g-search3.alicdn.com/img/bao/uploaded/i4/i1/2653324232/O1CN01qDJHEK1h8IjkVPXYa_!!0-item_pic.jpg_230x230.jpg', 'price': '¥52.00', 'deal': '6000+', 'title': '沈厅 周庄特产沈万三家蹄髈1000g猪蹄酱肘子蹄膀肉类熟食卤味美食', 'shop': '沈厅旗舰店', 'location': '江苏 苏州', '_id': ObjectId('5e65b81d070577c77949f270')} 存储到MongoDB成功 {'image': '//g-search3.alicdn.com/img/bao/uploaded/i4/i1/475325704/O1CN01euNxPt1s0TjwGTYLb_!!0-item_pic.jpg_230x230.jpg', 'price': '¥86.70', 'deal': '257', 'title': '满减【知味观杭州酱鸭】酱板鸭浙江特产鸭肉小吃美食卤味零食熟食', 'shop': '知味观官方旗舰店', 'location': '浙江 杭州', '_id': ObjectId('5e65b81d070577c77949f271')} 存储到MongoDB成功 {'image': '//g-search1.alicdn.com/img/bao/uploaded/i4/i1/2780349775/TB2kLjErxSYBuNjSsphXXbGvVXa_!!2780349775-0-item_pic.jpg_230x230.jpg', 'price': '¥59.90', 'deal': '2', 'title': '正宗安徽特产糯米锅巴2400g 传统美食零食小吃批发 大份量', 'shop': '徽味和旗舰店', 'location': '安徽 黄山', '_id': ObjectId('5e65b81d070577c77949f272')} 存储到MongoDB成功 {'image': '//g-search3.alicdn.com/img/bao/uploaded/i4/i3/2780349775/O1CN01vNKwyC2M507TWBZot_!!0-item_pic.jpg_230x230.jpg', 'price': '¥24.90', 'deal': '21', 'title': '徽味和 零食小吃营养办公室休闲美食芝士小脆条好吃糕点2罐', 'shop': '徽味和旗舰店', 'location': '安徽 黄山', '_id': ObjectId('5e65b81d070577c77949f273')} 存储到MongoDB成功 {'image': '//g-search3.alicdn.com/img/bao/uploaded/i4/i3/3017400344/O1CN01uenr341EPappYcz5V_!!0-item_pic.jpg_230x230.jpg', 'price': '¥77.40', 'deal': '3.5万+', 'title': '好欢螺螺蛳粉300g*6袋柳州特产螺狮粉美食螺丝粉煮水方便面酸辣粉', 'shop': '好欢螺旗舰店', 'location': '广西 柳州', '_id': ObjectId('5e65b81d070577c77949f274')} 存储到MongoDB成功 {'image': '//g-search3.alicdn.com/img/bao/uploaded/i4/i4/392147177/O1CN01fiVlzN22t78xBwRdQ_!!0-item_pic.jpg_230x230.jpg', 'price': '¥59.90', 'deal': '5000+', 'title': '【周黑鸭旗舰店_锁鲜】气调盒装卤鸭舌150g 美食特产食品零食小吃', 'shop': '周黑鸭食品旗舰店', 'location': '上海', '_id': ObjectId('5e65b81d070577c77949f275')} 存储到MongoDB成功 {'image': '//g-search3.alicdn.com/img/bao/uploaded/i4/i1/392147177/O1CN01AngkGR22t79TKoYq1_!!0-item_pic.jpg_230x230.jpg', 'price': '¥49.90', 'deal': '2.0万+', 'title': '【周黑鸭旗舰店】锁鲜卤鸭脖200g鸭锁骨240g美食特产零食小吃熟食', 'shop': '周黑鸭食品旗舰店', 'location': '上海', '_id': ObjectId('5e65b81d070577c77949f276')} 存储到MongoDB成功 {'image': '//g-search1.alicdn.com/img/bao/uploaded/i4/i1/3282604381/O1CN01xnrcQx1iEXjdPvrjc_!!0-item_pic.jpg_230x230.jpg', 'price': '¥39.90', 'deal': '1.5万+', 'title': '轩妈家芝士酥4枚 蛋黄酥芝士雪媚娘麻薯软糯新鲜糕点美食早餐零食', 'shop': '轩妈食品旗舰店', 'location': '广西 南宁', '_id': ObjectId('5e65b81d070577c77949f277')} 存储到MongoDB成功 {'image': '//g-search3.alicdn.com/img/bao/uploaded/i4/i4/2453625574/O1CN014YbSCz1r2wFmsUoev_!!0-item_pic.jpg_230x230.jpg', 'price': '¥105.00', 'deal': '310', 'title': '满299减200丨香辣卤鸭舌头四川美食地方特色小零食下酒菜网红小吃', 'shop': '肖三婆旗舰店', 'location': '四川 成都', '_id': ObjectId('5e65b81d070577c77949f278')} 存储到MongoDB成功 {'image': None, 'price': '¥48.00', 'deal': '7000+', 'title': '轩妈家蛋黄酥芝士冰沙味55g*6枚 雪媚娘夹心馅美食糕点早餐零食', 'shop': '轩妈食品旗舰店', 'location': '广西 南宁', '_id': ObjectId('5e65b81d070577c77949f279')} 存储到MongoDB成功 {'image': None, 'price': '¥56.80', 'deal': '1253', 'title': '草原今朝风干牛肉干原味106g内蒙古特产新鲜真空包装休闲零食美食', 'shop': '天猫超市', 'location': '上海', '_id': ObjectId('5e65b81d070577c77949f27a')} 存储到MongoDB成功 {'image': None, 'price': '¥22.90', 'deal': '9.5万+', 'title': '三只松鼠蜀香麻辣味牛肉干100g麻辣小零食熟食特产牛肉粒美食小吃', 'shop': '天猫超市', 'location': '上海', '_id': ObjectId('5e65b81d070577c77949f27b')} 存储到MongoDB成功 {'image': None, 'price': '¥19.90', 'deal': '3.5万+', 'title': '【良品铺子-甜辣鸭脖子190g】卤味零食小吃美食休闲食品小包装', 'shop': '良品铺子旗舰店', 'location': '广东 广州', '_id': ObjectId('5e65b81d070577c77949f27c')} 存储到MongoDB成功 {'image': None, 'price': '¥44.70', 'deal': '1.5万+', 'title': '好欢螺螺蛳粉柳州美食特产螺狮粉400g*3袋螺丝粉速食方便面酸辣粉', 'shop': '好欢螺旗舰店', 'location': '广西 柳州', '_id': ObjectId('5e65b81d070577c77949f27d')} 存储到MongoDB成功 {'image': None, 'price': '¥208.00', 'deal': '22', 'title': '【满299减200】肖三婆腊猪尾巴农家自制腊味手工美食烟熏腊肉香肠', 'shop': '肖三婆旗舰店', 'location': '四川 成都', '_id': ObjectId('5e65b81d070577c77949f27e')} 存储到MongoDB成功 {'image': None, 'price': '¥17.90', 'deal': '4564', 'title': '满减【三只松鼠_白玉川式花生酥135g】美食早餐小吃点心休闲零食', 'shop': '三只松鼠旗舰店', 'location': '安徽 芜湖', '_id': ObjectId('5e65b81d070577c77949f27f')} 存储到MongoDB成功 {'image': None, 'price': '¥90.00', 'deal': '302', 'title': '友臣肉松饼办公室零食特产早餐整箱小吃糕点1250g*2箱美食', 'shop': '友臣旗舰店', 'location': '福建 泉州', '_id': ObjectId('5e65b81d070577c77949f280')} 存储到MongoDB成功 {'image': None, 'price': '¥66.00', 'deal': '1315', 'title': '桂花鸭南京特产盐水鸭正宗银桂流香真空板鸭美食熟食品咸水鸭1kg', 'shop': '桂花鸭旗舰店', 'location': '江苏 南京', '_id': ObjectId('5e65b81d070577c77949f281')} 存储到MongoDB成功 {'image': None, 'price': '¥29.90', 'deal': '400', 'title': '上好旺香甜玉米酥1斤花生芝麻点心特产美食小吃早餐零食饼干糕点', 'shop': '天猫超市', 'location': '上海', '_id': ObjectId('5e65b81d070577c77949f282')} 存储到MongoDB成功 {'image': None, 'price': '¥17.20', 'deal': '1.0万+', 'title': '【百草味】麻薯(抹茶味)210g*2袋装 糕点小吃美食 早餐休闲零食', 'shop': '天猫超市', 'location': '上海', '_id': ObjectId('5e65b81d070577c77949f283')} 存储到MongoDB成功 {'image': None, 'price': '¥31.90', 'deal': '820', 'title': '蜜诺达法式咸芝士西饼150g*2罐曲奇饼干烘焙零食休闲小吃美食早餐', 'shop': '天猫超市', 'location': '上海', '_id': ObjectId('5e65b81d070577c77949f284')} 存储到MongoDB成功 {'image': None, 'price': '¥65.00', 'deal': '5.5万+', 'title': '螺状元柳州螺蛳粉特产美食方便面速食螺狮粉米线广西螺丝粉', 'shop': '螺状元旗舰店', 'location': '广西 柳州', '_id': ObjectId('5e65b81d070577c77949f285')} 存储到MongoDB成功 {'image': None, 'price': '¥29.00', 'deal': '4623', 'title': '沈大成糕点桂花拉糕上海特产老字号传统手工糕点心网红美食桂花糕', 'shop': '沈大成旗舰店', 'location': '上海', '_id': ObjectId('5e65b81d070577c77949f286')} 存储到MongoDB成功 {'image': None, 'price': '¥1550.00', 'deal': '42', 'title': 'Hape 美食家超能大厨房大型仿真厨房过家家玩具女孩益智玩具', 'shop': '天天装饰店', 'location': '江苏 苏州', '_id': ObjectId('5e65b81d070577c77949f287')} 存储到MongoDB成功 {'image': None, 'price': '¥115.00', 'deal': '6000+', 'title': '螺蛳粉螺霸王螺丝粉广西柳州正宗美食特产10包礼盒装整箱螺狮粉', 'shop': '广西御品香食品有限公司店', 'location': '广西 柳州', '_id': ObjectId('5e65b81d070577c77949f288')} 存储到MongoDB成功 {'image': '//g-search3.alicdn.com/img/bao/uploaded/i4/i2/1692258071/O1CN0150relj29UZEc14hL8_!!0-item_pic.jpg_230x230.jpg', 'price': '¥28.90', 'deal': '1653', 'title': '稻香村芝麻瓦片450g好吃传统糕点点心饼干休闲零食品美食特产小吃', 'shop': '稻香村食品旗舰店', 'location': '北京', '_id': ObjectId('5e65b81d070577c77949f289')} 存储到MongoDB成功 {'image': '//g-search3.alicdn.com/img/bao/uploaded/i4/i2/1893751150/O1CN01Nj0a4i1KMk3w3iaWc_!!0-item_pic.jpg_230x230.jpg', 'price': '¥44.50', 'deal': '1749', 'title': '奇多粟米棒食品小吃零食礼包整箱牛排火鸡味60g*12包怀旧美食', 'shop': '百事集团官方旗舰店', 'location': '江苏 无锡', '_id': ObjectId('5e65b81d070577c77949f28a')} 存储到MongoDB成功 {'image': '//g-search3.alicdn.com/img/bao/uploaded/i4/i1/739302607/O1CN010g60Ei1V8383BrfNA_!!0-item_pic.jpg_230x230.jpg', 'price': '¥158.60', 'deal': '509', 'title': '乐奈网红零食大礼包女生组合一整箱多口味混装办公室休闲小吃美食', 'shop': '乐奈旗舰店', 'location': '江苏 苏州', '_id': ObjectId('5e65b81d070577c77949f28b')} 存储到MongoDB成功 {'image': '//g-search1.alicdn.com/img/bao/uploaded/i4/i3/1023528406/O1CN01HhlFtI2BxzukCu07L_!!0-item_pic.jpg_230x230.jpg', 'price': '¥108.00', 'deal': '416', 'title': '广州酒家天天向上糕点零食礼包礼盒广东美食小吃饼干节日送礼手信', 'shop': '广州酒家旗舰店', 'location': '广东 广州', '_id': ObjectId('5e65b81d070577c77949f28c')} 存储到MongoDB成功 {'image': '//g-search3.alicdn.com/img/bao/uploaded/i4/i3/2033032140/O1CN01GNrsff1RgA49Axs63_!!0-item_pic.jpg_230x230.jpg', 'price': '¥55.00', 'deal': '1517', 'title': '杏花楼老字号上海美食传统熟食咸鸡即食卤味白鸡切盐水鸡真空', 'shop': '杏花楼食品旗舰店', 'location': '上海', '_id': ObjectId('5e65b81d070577c77949f28d')} 存储到MongoDB成功 {'image': '//g-search3.alicdn.com/img/bao/uploaded/i4/i3/3087037216/O1CN01H2Zloe23Ayb8fSOLI_!!0-item_pic.jpg_230x230.jpg', 'price': '¥34.90', 'deal': '1.5万+', 'title': '螺状元柳州螺蛳粉少女粉特产美食螺狮粉辣方便面速食广西螺丝粉', 'shop': '螺状元旗舰店', 'location': '广西 柳州', '_id': ObjectId('5e65b81d070577c77949f28e')} 存储到MongoDB成功 {'image': '//g-search2.alicdn.com/img/bao/uploaded/i4/i1/1690440456/O1CN01smbxix1FEtBBWAS1F_!!0-item_pic.jpg_230x230.jpg', 'price': '¥19.90', 'deal': '9000+', 'title': '友臣散装肉松饼500g营养早餐糕点网红零食美食小吃休闲食品点心', 'shop': '友臣旗舰店', 'location': '福建 泉州', '_id': ObjectId('5e65b81d070577c77949f28f')} 存储到MongoDB成功 {'image': '//g-search3.alicdn.com/img/bao/uploaded/i4/i1/4010105128/O1CN01JeN8N51nkfbv6BZzk_!!0-item_pic.jpg_230x230.jpg', 'price': '¥69.90', 'deal': '1006', 'title': '嗨吃家酸辣粉桶装整箱12桶重庆网红美食嗨吃家红薯粉丝方便速食', 'shop': '川之味食品专营店', 'location': '河南 郑州', '_id': ObjectId('5e65b81d070577c77949f290')} 存储到MongoDB成功 {'image': '//g-search3.alicdn.com/img/bao/uploaded/i4/i1/619123122/O1CN01arHaI81Yvv6WAes8F_!!0-item_pic.jpg_230x230.jpg', 'price': '¥26.90', 'deal': '1.5万+', 'title': '【良品铺子-肉松饼380g】早餐糕点零食美食小吃休闲食品满减', 'shop': '良品铺子旗舰店', 'location': '广东 广州', '_id': ObjectId('5e65b81d070577c77949f291')} 存储到MongoDB成功 {'image': '//g-search2.alicdn.com/img/bao/uploaded/i4/i3/732501769/O1CN01tu2gBR1OwFECXHtB9_!!0-item_pic.jpg_230x230.jpg', 'price': '¥18.90', 'deal': '1923', 'title': '来伊份桃酥252g饼干传统糕点点心酥饼休闲零食小吃美食食品核桃酥', 'shop': '来伊份官方旗舰店', 'location': '上海', '_id': ObjectId('5e65b81d070577c77949f292')} 存储到MongoDB成功 {'image': '//g-search3.alicdn.com/img/bao/uploaded/i4/i4/3477045551/O1CN01PUnfzV1qsP9IpGzgu_!!0-item_pic.jpg_230x230.jpg', 'price': '¥63.88', 'deal': '4155', 'title': '柳螺宗蛳螺蛳粉正宗柳州特产美食330g*5袋螺狮粉整箱礼盒装螺丝粉', 'shop': '柳螺宗蛳旗舰店', 'location': '广西 柳州', '_id': ObjectId('5e65b81d070577c77949f293')} 存储到MongoDB成功 {'image': '//g-search2.alicdn.com/img/bao/uploaded/i4/i2/1692258071/O1CN01lL4kNM29UZEeF0HzW_!!0-item_pic.jpg_230x230.jpg', 'price': '¥26.90', 'deal': '1776', 'title': '稻香村江米条260g*2特色传统好吃的特产80后怀旧美食小吃零食茶点', 'shop': '稻香村食品旗舰店', 'location': '北京', '_id': ObjectId('5e65b81d070577c77949f294')} 正在翻到第3页 进程已结束，退出代码 -1就是不知道为什么有的图片获取不到链接？不用PhantomJS就可以全部获取到。不用PhantomJS的时候{'image': '//g.alicdn.com/s.gif', 'price': '¥69.90', 'deal': '1422', 'title': '满299减200丨自贡冷吃牛肉120g肖三婆四川麻辣牛肉干美食真空熟食', 'shop': '肖三婆旗舰店', 'location': '四川 成都', '_id': ObjectId('5e65bdbc60aa342626aa2447')}用PhantomJS的时候{'image': None, 'price': '¥69.90', 'deal': '1422', 'title': '满299减200丨自贡冷吃牛肉120g肖三婆四川麻辣牛肉干美食真空熟食', 'shop': '肖三婆旗舰店', 'location': '四川 成都', '_id': ObjectId('5e65b818070577c77949f246')}对比发现可能是爬取速度太快没有加载出来gif图片，但是加入time.sleep(5)依然如此，这是可能是PhantomJS的一个bug，改用Chrome Headless模式（Chrome 59及以上）chrome_options = webdriver.ChromeOptions() chrome_options.add_argument('--headless') browser = webdriver.Chrome(chrome_options=chrome_options)部分结果：存储到MongoDB成功 {'image': '//g-search1.alicdn.com/img/bao/uploaded/i4/imgextra/i3/211060109/O1CN01g5A8VZ1Cfxk1wE0a8_!!0-saturn_solar.jpg_180x180.jpg', 'price': '¥59.80', 'deal': '6000+', 'title': '山东特产酱牛肉卤牛肉熟食五香真空480g健身牛肉牛腱肉即食小包装', 'shop': '日彤旗舰店', 'location': '山东 青岛', '_id': ObjectId('5e65c110d162fe0e0bcd1a8f')} 存储到MongoDB成功 {'image': '//g-search2.alicdn.com/img/bao/uploaded/i4/i2/475325704/O1CN01SoS4Ez1s0TkMD1y5E_!!0-item_pic.jpg_180x180.jpg', 'price': '¥10.90', 'deal': '7.5万+', 'title': '知味观艾草青团网红美食咸蛋黄肉松糯米团子杭州特产糕点小吃零食', 'shop': '知味观官方旗舰店', 'location': '浙江 杭州', '_id': ObjectId('5e65c110d162fe0e0bcd1a90')} 存储到MongoDB成功 {'image': '//g-search3.alicdn.com/img/bao/uploaded/i4/i1/475325704/O1CN01qUbxld1s0TkL8kzr4_!!0-item_pic.jpg_180x180.jpg', 'price': '¥19.90', 'deal': '8000+', 'title': '知味观绿豆糕杭州特产桂花绿豆饼糕点好吃的老式传统美食抹茶零食', 'shop': '知味观官方旗舰店', 'location': '浙江 杭州', '_id': ObjectId('5e65c110d162fe0e0bcd1a91')} 存储到MongoDB成功 {'image': '//g-search2.alicdn.com/img/bao/uploaded/i4/i3/2780349775/O1CN01fdbBay2M507ViTO7T_!!0-item_pic.jpg_180x180.jpg', 'price': '¥19.90', 'deal': '801', 'title': '安徽特产正宗黄山烧饼60个梅干菜扣肉饼手工美食小吃零食糕点', 'shop': '徽味和旗舰店', 'location': '安徽 黄山', '_id': ObjectId('5e65c110d162fe0e0bcd1a92')} 存储到MongoDB成功 {'image': '//g-search3.alicdn.com/img/bao/uploaded/i4/i1/2901136168/O1CN01ONmRqA1vQzVLiJB2S_!!0-item_pic.jpg_180x180.jpg', 'price': '¥171.00', 'deal': '4299', 'title': '美珍香迷你金钱烧烤猪肉200g+迷你休闲烧烤猪肉200g小吃零食美食', 'shop': '美珍香旗舰店', 'location': '上海', '_id': ObjectId('5e65c110d162fe0e0bcd1a93')} 存储到MongoDB成功 {'image': '//g-search2.alicdn.com/img/bao/uploaded/i4/i1/725677994/O1CN01C9jVrG28vIjnT4bsM_!!725677994-0-sm.jpg_180x180.jpg', 'price': '¥139.00', 'deal': '4156', 'title': '科尔沁手撕风干牛肉干400g原味内蒙古特产牛肉干美食零食小吃', 'shop': '天猫超市', 'location': '上海', '_id': ObjectId('5e65c110d162fe0e0bcd1a94')} 存储到MongoDB成功 {'image': '//g-search3.alicdn.com/img/bao/uploaded/i4/i2/2780349775/O1CN01blLMR12M506FU8JES_!!0-item_pic.jpg_180x180.jpg', 'price': '¥19.90', 'deal': '1216', 'title': '咸海鸭蛋黄酥雪媚娘12枚早餐面包网红美食糕点心零食小吃休闲食品', 'shop': '徽味和旗舰店', 'location': '安徽 黄山', '_id': ObjectId('5e65c110d162fe0e0bcd1a95')} 存储到MongoDB成功 {'image': '//g-search3.alicdn.com/img/bao/uploaded/i4/i3/3282604381/O1CN018msmXw1iEXkerMyhB_!!3282604381.jpg_180x180.jpg', 'price': '¥89.00', 'deal': '1.0万+', 'title': '轩妈家蛋黄酥2盒 红豆味雪媚娘麻薯新鲜糕点美食网红零食小吃早餐', 'shop': '轩妈食品旗舰店', 'location': '广西 南宁', '_id': ObjectId('5e65c110d162fe0e0bcd1a96')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥65.80', 'deal': '2.5万+', 'title': '轩妈家蛋黄酥4种口味组合混合装糕点点心美食零食小吃早餐食品', 'shop': '轩妈食品旗舰店', 'location': '广西 南宁', '_id': ObjectId('5e65c110d162fe0e0bcd1a97')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥44.80', 'deal': '3.5万+', 'title': '友臣正宗肉松饼整箱休闲早零食充饥夜宵特产糕点美食营养食品面包', 'shop': '友臣旗舰店', 'location': '福建 泉州', '_id': ObjectId('5e65c110d162fe0e0bcd1a98')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥38.90', 'deal': '1.5万+', 'title': '【百草味-肉松饼1kg】网红休闲零食特色小吃美食点心传统', 'shop': '百草味旗舰店', 'location': '浙江 杭州', '_id': ObjectId('5e65c110d162fe0e0bcd1a99')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥59.90', 'deal': '2569', 'title': '好丽友薯愿5连包休闲膨化薯片礼包新老包装饼干美食小吃随机发货', 'shop': '天猫超市', 'location': '上海', '_id': ObjectId('5e65c110d162fe0e0bcd1a9a')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥64.50', 'deal': '6.0万+', 'title': '好欢螺螺蛳粉柳州特产美食酸辣粉300gx5袋螺狮粉速食方便面米线', 'shop': '好欢螺旗舰店', 'location': '广西 柳州', '_id': ObjectId('5e65c110d162fe0e0bcd1a9b')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥69.90', 'deal': '1440', 'title': '满299减200丨自贡冷吃牛肉120g肖三婆四川麻辣牛肉干美食真空熟食', 'shop': '肖三婆旗舰店', 'location': '四川 成都', '_id': ObjectId('5e65c110d162fe0e0bcd1a9c')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥29.90', 'deal': '10万+', 'title': '满减【三只松鼠_蜀香牛肉100g】休闲零食小吃肉脯特产牛肉干美食', 'shop': '三只松鼠旗舰店', 'location': '安徽 芜湖', '_id': ObjectId('5e65c110d162fe0e0bcd1a9d')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥25.90', 'deal': '6.5万+', 'title': '【良品铺子-猪肉脯200g】零食小吃肉干网红休闲食品美食小包装', 'shop': '良品铺子旗舰店', 'location': '广东 广州', '_id': ObjectId('5e65c110d162fe0e0bcd1a9e')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥119.80', 'deal': '1184', 'title': '【周黑鸭旗舰店_锁鲜】气调盒装卤鸭舌150g*2 美食特产零食品小吃', 'shop': '周黑鸭食品旗舰店', 'location': '湖北 武汉', '_id': ObjectId('5e65c110d162fe0e0bcd1a9f')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥118.00', 'deal': '2100', 'title': '李村猪肉脂渣香酥油渣干炸五花肉粕青岛特产小吃美食肉类生酮零食', 'shop': '李村旗舰店', 'location': '山东 青岛', '_id': ObjectId('5e65c110d162fe0e0bcd1aa0')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥99.00', 'deal': '2054', 'title': '科尔沁超干牛肉干175g原味内蒙古风干牛肉干草原特产手撕零食美食', 'shop': '天猫超市', 'location': '上海', '_id': ObjectId('5e65c110d162fe0e0bcd1aa1')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥59.00', 'deal': '6000+', 'title': '好丽友呀土豆9连包超值礼包实惠家庭装休闲膨化薯片饼干美食小吃', 'shop': '天猫超市', 'location': '上海', '_id': ObjectId('5e65c110d162fe0e0bcd1aa2')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥74.50', 'deal': '2.0万+', 'title': '好欢螺螺蛳粉柳州美食螺丝粉400g*5袋螺狮粉速食懒人方便面非泡面', 'shop': '好欢螺旗舰店', 'location': '广西 柳州', '_id': ObjectId('5e65c110d162fe0e0bcd1aa3')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥288.00', 'deal': '8', 'title': '【周黑鸭门店同款】熹礼礼盒920g 含整鸭 美食特产零食大礼包礼盒', 'shop': '周黑鸭食品旗舰店', 'location': '湖北 武汉', '_id': ObjectId('5e65c110d162fe0e0bcd1aa4')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥73.50', 'deal': '2989', 'title': '友臣肉松饼2.1kg营养早餐点心美食晚上解饿零食糕点整箱批发面包', 'shop': '友臣旗舰店', 'location': '福建 泉州', '_id': ObjectId('5e65c110d162fe0e0bcd1aa5')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥36.80', 'deal': '1.5万+', 'title': '蛋黄酥海鸭蛋零食小吃网红充饥夜宵特产美食糕点点心整箱休闲食品', 'shop': '比比赞旗舰店', 'location': '福建 厦门', '_id': ObjectId('5e65c110d162fe0e0bcd1aa6')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥29.80', 'deal': '5.5万+', 'title': '卫龙大礼包辣条亲嘴烧豆干麻辣味整箱儿时小吃休闲美食网红零食品', 'shop': '猫诚旗舰店', 'location': '安徽 合肥', '_id': ObjectId('5e65c110d162fe0e0bcd1aa7')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥69.90', 'deal': '1064', 'title': '满299减200丨肖三婆无骨鸭掌150g麻辣去脱骨鸭爪四川特产卤味美食', 'shop': '肖三婆旗舰店', 'location': '四川 成都', '_id': ObjectId('5e65c110d162fe0e0bcd1aa8')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥45.90', 'deal': '1869', 'title': '阿宽白家红油面皮12袋1260g特色小吃方便面非火鸡面成都特色美食', 'shop': '天猫超市', 'location': '上海', '_id': ObjectId('5e65c110d162fe0e0bcd1aa9')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥64.90', 'deal': '1120', 'title': '盼盼肉松饼整箱营养早餐糕点小吃面包特产美食网红小零食2100g', 'shop': '盼盼食品官方旗舰店', 'location': '河南 漯河', '_id': ObjectId('5e65c110d162fe0e0bcd1aaa')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥189.00', 'deal': '1103', 'title': '散装【卫龙旗舰店】魔芋爽整箱辣条毛肚素食香麻辣网红美食小袋装', 'shop': '卫龙食品旗舰店', 'location': '河南 漯河', '_id': ObjectId('5e65c110d162fe0e0bcd1aab')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥123.00', 'deal': '2619', 'title': '【德州扒鸡旗舰店】德州扒鸡正宗鸡爪熟食零食美食德州 扒鸡600g3', 'shop': '德州扒鸡旗舰店', 'location': '山东 德州', '_id': ObjectId('5e65c110d162fe0e0bcd1aac')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥92.90', 'deal': '1796', 'title': '廖记棒棒鸡无骨鸡爪两份920g 四川特色小吃麻辣无骨鸡爪零食美食', 'shop': '廖记棒棒鸡旗舰店', 'location': '四川 成都', '_id': ObjectId('5e65c110d162fe0e0bcd1aad')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥68.00', 'deal': '230', 'title': '沈大成糕点桂花拉糕2盒 上海特产老字号 糯米糕点心 网红美食', 'shop': '沈大成旗舰店', 'location': '上海', '_id': ObjectId('5e65c110d162fe0e0bcd1aae')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥39.90', 'deal': '5500+', 'title': '嘉华鲜花饼云腿小饼12枚礼袋云南特产零食小吃美食早餐传统糕点心', 'shop': '嘉华食品旗舰店', 'location': '云南 昆明', '_id': ObjectId('5e65c110d162fe0e0bcd1aaf')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥19.90', 'deal': '3.5万+', 'title': '【良品铺子-甜辣鸭脖子190g】卤味零食小吃美食休闲食品小包装', 'shop': '良品铺子旗舰店', 'location': '广东 广州', '_id': ObjectId('5e65c110d162fe0e0bcd1ab0')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥56.00', 'deal': '2859', 'title': '桂花鸭南京盐水鸭1000g正宗江苏特产年货美食板鸭咸水鸭真空熟食', 'shop': '桂花鸭旗舰店', 'location': '江苏 南京', '_id': ObjectId('5e65c110d162fe0e0bcd1ab1')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥69.90', 'deal': '1963', 'title': '双鱼猪肉脯400克靖江特产猪肉铺金奖猪肉干自然片老字号中华美食', 'shop': '双鱼食品旗舰店', 'location': '江苏 泰州', '_id': ObjectId('5e65c110d162fe0e0bcd1ab2')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥84.90', 'deal': '2087', 'title': '桃李天然酵母面包1800g营养早餐零食美食品手撕口袋面包蛋糕整箱', 'shop': '桃李食品旗舰店', 'location': '辽宁 沈阳', '_id': ObjectId('5e65c110d162fe0e0bcd1ab3')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥69.00', 'deal': '1567', 'title': '杨大爷五花腊肉500g四川美食特产腊肉农家自制烟熏肥咸肉柴火腊肉', 'shop': '杨大爷旗舰店', 'location': '四川 成都', '_id': ObjectId('5e65c110d162fe0e0bcd1ab4')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥20.50', 'deal': '3567', 'title': '满减【三只松鼠_墨玉川式芝麻酥135g】美食早餐小吃点心休闲零食', 'shop': '三只松鼠旗舰店', 'location': '安徽 芜湖', '_id': ObjectId('5e65c110d162fe0e0bcd1ab5')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥29.90', 'deal': '4786', 'title': '来伊份虎皮蛋糕168gx2糕点零食奶香夹心蛋糕美食早餐软点心小包装', 'shop': '来伊份官方旗舰店', 'location': '上海', '_id': ObjectId('5e65c110d162fe0e0bcd1ab6')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥109.00', 'deal': '729', 'title': '桂花鸭南京盐水鸭+酱鸭2000g特产正宗美食送礼真空装熟食年货食品', 'shop': '桂花鸭旗舰店', 'location': '江苏 南京', '_id': ObjectId('5e65c110d162fe0e0bcd1ab7')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥178.00', 'deal': '510', 'title': '修文鸭舌温州特产酱鸭舌酱卤鸭舌头原味美食小吃休闲零食净重480g', 'shop': '修文食品官方旗舰店', 'location': '浙江 温州', '_id': ObjectId('5e65c110d162fe0e0bcd1ab8')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥29.90', 'deal': '3.0万+', 'title': '绝艺鸭货零食大礼包麻辣味网红小吃休闲食品充饥夜宵整箱散装美食', 'shop': '绝艺食品旗舰店', 'location': '湖南 长沙', '_id': ObjectId('5e65c110d162fe0e0bcd1ab9')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥121.00', 'deal': '1150', 'title': '【旗舰店】螺状元柳州螺蛳粉280g*10袋礼盒装特产美食广西螺丝粉', 'shop': '螺状元旗舰店', 'location': '广西 柳州', '_id': ObjectId('5e65c110d162fe0e0bcd1aba')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥36.90', 'deal': '1.0万+', 'title': '沈师傅鸡蛋干四川特产豆腐干成都美食豆干小吃零食休闲食品非150g', 'shop': '沈师傅旗舰店', 'location': '四川 成都', '_id': ObjectId('5e65c110d162fe0e0bcd1abb')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥29.90', 'deal': '1.0万+', 'title': '五芳斋绿豆糕伴手礼桂花糕办公室点心休闲小吃零食绿豆饼好吃美食', 'shop': '五芳斋官方旗舰店', 'location': '浙江 嘉兴', '_id': ObjectId('5e65c110d162fe0e0bcd1abc')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥90.00', 'deal': '679', 'title': '美珍香芝士烧烤猪肉200g女生办公室零食网红特产小吃小孩肉类美食', 'shop': '美珍香旗舰店', 'location': '上海', '_id': ObjectId('5e65c110d162fe0e0bcd1abd')} 存储到MongoDB成功 {'image': '//g.alicdn.com/s.gif', 'price': '¥60.00', 'deal': '1620', 'title': '奇多粟米棒休闲食品小吃零食整箱混装90*12童年回忆怀旧网红美食', 'shop': '百事集团官方旗舰店', 'location': '江苏 无锡', '_id': ObjectId('5e65c110d162fe0e0bcd1abe')}参考文章：https://cuiqingcai.com/5657.html
结果如下：程序运行结果"C:\Program Files\Python\Python38\python.exe" E:/PycharmProjects/test/爬虫/今日头条街拍/Spider.py 请求文章详情页出错 None 正在下载1d47b4dceb635bff92ef296ce530cdc2.jpg 正在下载bff2d27b1d4ed77cc0a575513b9eeea4.jpg 正在下载f30c57b85c75fe655612450c993b320b.jpg 正在下载2475f2ad97bdcb6a45e6d64ce1650ca6.jpg 正在下载52fc1cd305b52366532f3ec7a9729a71.jpg 正在下载dc59cae9ed2859454c461b2944b819b1.jpg 正在下载bf1b48c4ca5cfeffec3bee95b1da6b64.jpg 正在下载7b8c8a28c037eac669988e34e90e37de.jpg 正在下载ad0fb9dbfcc0f15981fd701339e13bb8.jpg 正在下载98486366369a8c0b79f4c6ced3fb51b0.jpg E:/PycharmProjects/test/爬虫/今日头条街拍/Spider.py:125: DeprecationWarning: insert is deprecated. Use insert_one or insert_many instead. if db[MONGO_TABLE].insert(result): 存储到MongoDB成功 {'url': 'http://toutiao.com/group/6760980286252515853/', 'title': '三里屯街拍', 'images': ['http://p9.pstatp.com/origin/pgc-image/f23cd60127824cb88b11256cf9ffe951', 'http://p9.pstatp.com/origin/pgc-image/0c54ffb46fdd4553ad99e9273a85643f', 'http://p9.pstatp.com/origin/pgc-image/da0dd5a6d8314f699de340c06a9093ec', 'http://p3.pstatp.com/origin/pgc-image/7fff7dff1863466883d0920481bc9ffe', 'http://p1.pstatp.com/origin/pgc-image/9ddcb34586514ab7ad6427c73c416f51', 'http://p3.pstatp.com/origin/pgc-image/a406850542ca496aa1f68333e42aea87', 'http://p1.pstatp.com/origin/pgc-image/50bb8781363e4e3e8e9e45137ded07f6', 'http://p3.pstatp.com/origin/pgc-image/6dfc140a4d814cd49295f210aa1499bd', 'http://p1.pstatp.com/origin/pgc-image/014679ab63584e0ca7f8612b8b120651', 'http://p9.pstatp.com/origin/pgc-image/be0226872a864d2aac76c28987938cdf'], '_id': ObjectId('5e648f564d5a25526d8630e9')} 请求文章详情页出错 None 正在下载289d58776687584857ea8d2cec8e3266.jpg 正在下载4d89bd5efc7166322207e31e737cd6d2.jpg 正在下载bcfd11725613120a2f6f20145521bf70.jpg 正在下载2256eed522bab696d578be7bd021a79d.jpg 正在下载9f4b6fac29acae9d0d3964a33922cd76.jpg 正在下载6226b26aacb6111fa5bb6ab4ecb360ca.jpg 正在下载22e469ecf6277bf6631e9053b0782656.jpg 正在下载fb6e9bba0afd3880fd5acb418c08af06.jpg 正在下载9e418d8f5aa93beefe64005a941b0b8d.jpg 正在下载dc98a060a3ee9abe1583bc304de1dfd1.jpg 存储到MongoDB成功 {'url': 'http://toutiao.com/group/6797731729667785220/', 'title': '10张街拍，都是移动的美景', 'images': ['http://p1.pstatp.com/origin/pgc-image/e783e840dfb54e3c8c30c385d1089345', 'http://p9.pstatp.com/origin/pgc-image/9476cd0974cb4a2984665b2c5b983212', 'http://p1.pstatp.com/origin/pgc-image/d4fbc13cfc2d43ac8161b4be08df3e14', 'http://p3.pstatp.com/origin/pgc-image/b18028cec93146a2b51e5671da0521d5', 'http://p1.pstatp.com/origin/pgc-image/64bd25e7787e4273a2286b35a3ae6446', 'http://p3.pstatp.com/origin/pgc-image/dfa087e2320241b3a17911d4e0ac3029', 'http://p3.pstatp.com/origin/pgc-image/3d8f1af2896147ee93bf2d2fd7ba9ca8', 'http://p1.pstatp.com/origin/pgc-image/120a3479c1e64c339fd248804e65e07a', 'http://p9.pstatp.com/origin/pgc-image/c4719a980d674138bcdf6f275ef02641', 'http://p3.pstatp.com/origin/pgc-image/9166a9f1c804471289a2561b132e6c2d'], '_id': ObjectId('5e648f584d5a25526d8630ea')} 请求文章详情页出错 None 正在下载058f885bfde3719ed25338005a437383.jpg 正在下载232333b9f0f2b87a553e8f24f728890e.jpg 正在下载b81adeef46b7948a2ae60ba19b1c2f9f.jpg 正在下载0617b7ed0ad9230354903c6afe97db35.jpg 正在下载a9a568400013d371b26f9ed5ed475867.jpg 正在下载3fe54e96b51b9ace46634e8f94ab5592.jpg 正在下载33110348606726d108c04b7c40b964d9.jpg 正在下载a1052b801e72efdbfc1c4cc0a81aac95.jpg 存储到MongoDB成功 {'url': 'http://toutiao.com/group/6798525975911989767/', 'title': '8张街拍，美腿是亮点', 'images': ['http://p1.pstatp.com/origin/pgc-image/016ab17507bd46639a130da594e0c5a7', 'http://p1.pstatp.com/origin/pgc-image/a812e94ff2634cd88e3212d0f8e2e69d', 'http://p3.pstatp.com/origin/pgc-image/2e71f3fe533e4907be31731dfa27d42b', 'http://p3.pstatp.com/origin/pgc-image/e57e58cf58204fa0849b6b10f27c2a63', 'http://p1.pstatp.com/origin/pgc-image/2430de0431354ccb98683a2e48886679', 'http://p1.pstatp.com/origin/pgc-image/9c122e7a3c764c249c5c1f8a89d2d92d', 'http://p1.pstatp.com/origin/pgc-image/d812aa22e3b94c5382afaf6c23970dcd', 'http://p3.pstatp.com/origin/pgc-image/015a672717b24791ba75ad876238c79b'], '_id': ObjectId('5e648f5a4d5a25526d8630eb')} 请求文章详情页出错 None 正在下载2f03708f2837f73dcb109d23f9416792.jpg 正在下载bd905f5aa9bbf02485958efdbbac1dd9.jpg 正在下载d217942affa862060bc9196e38d7c79c.jpg 正在下载81bfdb8072c2345216b26df2eacad4de.jpg 正在下载49187040d908d5ecaaa66fc1d4065594.jpg 正在下载63afad5c014c8b814f3f2985e1f6f0e9.jpg 正在下载32b7ad87244b35dfb0537aa17db4d481.jpg 正在下载788e4bc0f4656154c3155e4c8fb8c86b.jpg 存储到MongoDB成功 {'url': 'http://toutiao.com/group/6544662303671845383/', 'title': '街拍美女，每个都不会让你失望，能拍到这么多很难得', 'images': ['http://p1.pstatp.com/origin/pgc-image/1523797525926884c65306e', 'http://p3.pstatp.com/origin/pgc-image/152379752620949b0806b6a', 'http://p3.pstatp.com/origin/pgc-image/1523797526532845db7eb8f', 'http://p9.pstatp.com/origin/pgc-image/1523797526872017fabff50', 'http://p1.pstatp.com/origin/pgc-image/15237975272443a6dc806be', 'http://p1.pstatp.com/origin/pgc-image/1523797527522d8e7dd116e', 'http://p1.pstatp.com/origin/pgc-image/15237975277918d0c1769d3', 'http://p9.pstatp.com/origin/pgc-image/152379753708045ae2bcea6'], '_id': ObjectId('5e648f5d4d5a25526d8630ec')} 请求文章详情页出错 None 正在下载1c24d58fcecb7c040d7eecb7f5f40812.jpg 正在下载57a39dd807a981d1cbc0ce114084bc5a.jpg 正在下载539b075ff4afec5baa3277758a7b6c4d.jpg 正在下载928ec49ea00572be1dc16bcbe970f0f7.jpg 正在下载7851da03c9b9d535a9c271a12db6d3d7.jpg 存储到MongoDB成功 {'url': 'http://toutiao.com/group/6801700984973165059/', 'title': '街拍时尚美女达人，个性时尚靓丽', 'images': ['http://p1.pstatp.com/origin/pgc-image/f5c5829387b14ff99685a28a0eeab0fe', 'http://p3.pstatp.com/origin/pgc-image/fdec9a612a6044feb92f981be07821ba', 'http://p3.pstatp.com/origin/pgc-image/4e1028d6ff804bdb8286087699c93dd6', 'http://p3.pstatp.com/origin/pgc-image/ec39dfbd5e6f4d1e8ddbf093c5dac423', 'http://p3.pstatp.com/origin/pgc-image/21be061a0fbf47d5a9084d707757a0e0'], '_id': ObjectId('5e648f614d5a25526d8630ed')} 请求文章详情页出错 None 正在下载60451c6c4904eb992260fe3337a7da85.jpg 正在下载4e8b28d7767d035ebb2e9be015af5f12.jpg 正在下载40f67d5373b2eb26f502002cc8d1379f.jpg 正在下载317532fa5039e4707a55f095f5287ea4.jpg 正在下载4f849724eadfb58e743d95ed35e01ca1.jpg 正在下载51a4b4e42cd90441c988d5747a1fa0ce.jpg 存储到MongoDB成功 {'url': 'http://toutiao.com/group/6793512652669714956/', 'title': '路人街拍，随性有度，高颜值任性', 'images': ['http://p1.pstatp.com/origin/pgc-image/812c6785511940859d0ae8340023cd33', 'http://p1.pstatp.com/origin/pgc-image/a95721f9184c467195c1f03ebf5ddb2d', 'http://p1.pstatp.com/origin/pgc-image/87a94ae849e64590a691f5866a75a6a6', 'http://p1.pstatp.com/origin/pgc-image/2463ca69bd38421eb2b3fcb87a2b6485', 'http://p3.pstatp.com/origin/pgc-image/437bf5b276ef4d178c33f3b5121aacad', 'http://p3.pstatp.com/origin/pgc-image/3729b42f46a741cd85366d08fa10dabe'], '_id': ObjectId('5e648f644d5a25526d8630ee')} 请求文章详情页出错 None 正在下载605a6964f274bf05359a94611d766c90.jpg 正在下载b263ab68d9f2a481282f0b95dd8185da.jpg 正在下载22229fb6e545aa1c362a864a254dc190.jpg 正在下载7178df50a0dc98dd8081462c55b39abb.jpg 正在下载c47eeecb2060eb7e979b26d201c89d85.jpg 正在下载8196e60f431fc88c07faf569b0d410d5.jpg 正在下载7b60211a6c1e85cd8d0a5b313a3eea54.jpg 正在下载a9e01aa5e7bf45092479ce5b545e5b43.jpg 正在下载704ab8f5cf3ed7fe6684c29fc85c32b9.jpg 正在下载ff47896bf7d103e1f11c92291a6e22fa.jpg 存储到MongoDB成功 {'url': 'http://toutiao.com/group/6798491818288742915/', 'title': '街拍：时尚的美女们那无处安放的魅力呀', 'images': ['http://p3.pstatp.com/origin/pgc-image/6ad69aabdd7b4638a4d1ae95ad03aa31', 'http://p3.pstatp.com/origin/pgc-image/d687b4a681d04c96966ca068571cbfc7', 'http://p1.pstatp.com/origin/pgc-image/5d1800490a45422a8ecf640aec508117', 'http://p3.pstatp.com/origin/pgc-image/0fbd7554e6e44b0baffeddba5e682397', 'http://p3.pstatp.com/origin/pgc-image/be0f015c0ef4494f891948cb9b2079df', 'http://p1.pstatp.com/origin/pgc-image/7f2443587bfe47a584e2fc03d6274b44', 'http://p9.pstatp.com/origin/pgc-image/7bad2342572f4141a72c963c3bf7489d', 'http://p9.pstatp.com/origin/pgc-image/546965a83e344dfe8939142381401839', 'http://p3.pstatp.com/origin/pgc-image/7f351bd5863146e384849ca68e858f89', 'http://p1.pstatp.com/origin/pgc-image/b087dddab5874b049eb97b5cc0e5a46e'], '_id': ObjectId('5e648f6b4d5a25526d8630ef')} 正在下载c0d75e4999e69d869e86d5fec1f59485.jpg 正在下载56ba253418c432c99a57331cf38c34d0.jpg 正在下载3d17fffb0618658810d3e03f4051a8ae.jpg 正在下载a0406a502caf02ff77cf96dd173c0a58.jpg 正在下载62d84cedab105e433c88afb0327780c6.jpg 正在下载ae8e01add6e9d85ec8aff9d495a68985.jpg 正在下载62be7702c19941666ab7550add3b0846.jpg 正在下载c40e65a1ee585414a10fd62c2f1abc3c.jpg 正在下载400900353f90b9f0c1dccbc41254bf6e.jpg 正在下载c55892d7a5d3bff48d2ec49698b8cc77.jpg 正在下载2bfb96396e6ac8c655994505d2787813.jpg 正在下载4f29434ac280b66c11c97d9cbee304a0.jpg 正在下载1a0a748c67847be27d477f4dc5629ce2.jpg 正在下载bbf03b4c64ee88e8f30f7ce9c4ffb75d.jpg 正在下载aa06350b58919b0bf4c8dcf67dfa051d.jpg 正在下载e8204bc0995bb67209f1ae2ce46dfa6d.jpg 正在下载5ae505e545b1a0ddae53f4d9e04af17e.jpg 正在下载3170b09e65c287c47d9424a569c8b211.jpg 正在下载93729e56d76c91baf217e668853b9675.jpg 正在下载d32daacb8c3c6760d171b25d257e620f.jpg 正在下载0b85fb287c9a9a0e1ed178ec3ce6c7ad.jpg 正在下载6632d9ceccb7f048060f6121d3471028.jpg 存储到MongoDB成功 {'url': 'http://toutiao.com/group/6360561337588465922/', 'title': '三里屯时尚街拍', 'images': ['http://p1.pstatp.com/origin/127a000565b624674d7f', 'http://p9.pstatp.com/origin/11f60008aea95af99269', 'http://p3.pstatp.com/origin/127b0000b91a74ee8aa0', 'http://p9.pstatp.com/origin/127b0000b91d0af5e30d', 'http://p9.pstatp.com/origin/11ff00035036c49b99ff', 'http://p1.pstatp.com/origin/127a000565c33e48688d', 'http://p3.pstatp.com/origin/127a000565c5bb7a220d', 'http://p1.pstatp.com/origin/127b0000bb5db97385a5', 'http://p3.pstatp.com/origin/127b0000bb839a6d7fdd', 'http://p3.pstatp.com/origin/11ff0003528897cbd6a3', 'http://p1.pstatp.com/origin/127b0000bbca727e9712', 'http://p1.pstatp.com/origin/11ff000352d0b620b45d', 'http://p3.pstatp.com/origin/127b0000bc09a4933d91', 'http://p3.pstatp.com/origin/127a000568ba70678b41', 'http://p3.pstatp.com/origin/11ff0003530c352041b2', 'http://p1.pstatp.com/origin/1279000000228a83fb2d', 'http://p1.pstatp.com/origin/11f80002e84fb20134ff', 'http://p1.pstatp.com/origin/127900000061ba8db7f1', 'http://p1.pstatp.com/origin/127d0000008129c92602', 'http://p9.pstatp.com/origin/127d000000c6b41742c7', 'http://p1.pstatp.com/origin/1279000000cfe9cf96a5', 'http://p3.pstatp.com/origin/127d000000e8996bb8a1'], '_id': ObjectId('5e648f714d5a25526d8630f0')} 正在下载e8b059259110fb7b2145238c783e1e16.jpg 正在下载4e611f9b0bf4f50be7da523398b81ccb.jpg 正在下载f114136a7df71b5e303903ed8bdfde16.jpg 正在下载08189490c08f7072cc3d7df8e2e3a9ca.jpg 正在下载73812fb5ba1d4f781cd86cccac76e7b1.jpg 存储到MongoDB成功 {'url': 'http://toutiao.com/group/6801620851247546887/', 'title': '街拍：身材好，朴素的搭配也好看', 'images': ['http://p3.pstatp.com/origin/pgc-image/229b29b9d46d41b59a6b1241b4f6522e', 'http://p3.pstatp.com/origin/pgc-image/22a06b2a0b9c452b91b8b8fe5ff9eeb9', 'http://p9.pstatp.com/origin/pgc-image/6545bf27a1d84b7695fe75913165dc3f', 'http://p1.pstatp.com/origin/pgc-image/68e79f9722524c2b9e95e369231e881f', 'http://p3.pstatp.com/origin/pgc-image/4add570ae30949319ee7a82a8a70905e'], '_id': ObjectId('5e648f744d5a25526d8630f1')} 正在下载6ad8e277bc909ab8b2aef5f65e6fc108.jpg 正在下载68dec26885c44b8d592b16799fab9bec.jpg 正在下载ca0d1280000bd094ee618107525c50cd.jpg 正在下载9f3eb9fb5e1587ba4ea6563b41bba065.jpg 正在下载b803cfbd980e1ea37c9943cecbe4d9d2.jpg 正在下载52beaad3de4da77a21d6b33b9c6bc535.jpg 正在下载818ec69ece423d6ef53df0e673755db3.jpg 正在下载4582c657f330e7925dad64d9a43ee23b.jpg 存储到MongoDB成功 {'url': 'http://toutiao.com/group/6801713871884124686/', 'title': '图虫街拍摄影：无题', 'images': ['http://p3.pstatp.com/origin/tuchong.fullscreen/243059128_tt', 'http://p1.pstatp.com/origin/tuchong.fullscreen/192138312_tt', 'http://p3.pstatp.com/origin/tuchong.fullscreen/311282017_tt', 'http://p1.pstatp.com/origin/tuchong.fullscreen/238865179_tt', 'http://p3.pstatp.com/origin/tuchong.fullscreen/229820783_tt', 'http://p3.pstatp.com/origin/tuchong.fullscreen/503761196_tt', 'http://p3.pstatp.com/origin/tuchong.fullscreen/63687246_tt', 'http://p1.pstatp.com/origin/tuchong.fullscreen/292407501_tt'], '_id': ObjectId('5e648f784d5a25526d8630f2')} 请求文章详情页出错 None 正在下载a83165d608142d3673f161ddcbe78473.jpg 正在下载2a3a99a77ecac2a5d5053b76984af14a.jpg 正在下载e13ff6d472651823cf060564621858c3.jpg 正在下载60715dabb78cb7f25bd4c7e773816b98.jpg 正在下载fd5a68dea6558fab2dbcd4ee33a66bb5.jpg 正在下载bea2d6122c2b4b9cac123b870fa2a2e5.jpg 正在下载1433ff923ee966d7aad93306a00e9194.jpg 正在下载3515669e22dc198da7413bd1bc144b26.jpg 正在下载2b0a30397d74c8307b2fe208c101cb6b.jpg 正在下载ea938a964c692a72889c3550946beb40.jpg 正在下载27acc644e75f99ed74c3d2fe7ac90c90.jpg 正在下载6e4d52ef6cd03cf1b08e1aa2f66049af.jpg 存储到MongoDB成功 {'url': 'http://toutiao.com/group/6761387978905354765/', 'title': '街拍美女', 'images': ['http://p3.pstatp.com/origin/pgc-image/75cedc8655974a5393d37001cc997ffb', 'http://p1.pstatp.com/origin/pgc-image/7867bd5c02c040519de20b4f7b6aec86', 'http://p1.pstatp.com/origin/pgc-image/85bb485b37ab4ae893333b2a3a1d3bdc', 'http://p3.pstatp.com/origin/pgc-image/25e8b5d6b07542e891d8589272dc43f0', 'http://p1.pstatp.com/origin/pgc-image/d241f49affaf43f1b8ccb26e5de6dfd9', 'http://p3.pstatp.com/origin/pgc-image/d86a1ed0b6a84e0b9df9e9132346751f', 'http://p3.pstatp.com/origin/pgc-image/78aa27e880eb415f9b08fcace47dbbad', 'http://p1.pstatp.com/origin/pgc-image/1752f41b2b86499d8986986783cb2986', 'http://p1.pstatp.com/origin/pgc-image/e55546f4cd29475da01997ded3d7c0d1', 'http://p1.pstatp.com/origin/pgc-image/25d0fc56b79a437086b70d57ee2d2d57', 'http://p9.pstatp.com/origin/pgc-image/d5c878a943ed46fb87e1c059831a1127', 'http://p3.pstatp.com/origin/pgc-image/0340686e0c7a417f8262fb8a9a0b6854'], '_id': ObjectId('5e648f7e4d5a25526d8630f3')} 正在下载69e442ab916aacb3381271b40536d918.jpg 正在下载db907cb5a1036864aff213d46984a88d.jpg 正在下载04b93d83f943a0507ed547b6736f535a.jpg 正在下载c5ead73b64e742f5f81fe29cb1f86fdf.jpg 正在下载21ed741bc8196cc52dc2e3881e3ea2b7.jpg 正在下载ced7135b971626d5830f01eee8e70813.jpg 正在下载7cc78999ee6e6ec05380d976884df636.jpg 存储到MongoDB成功 {'url': 'http://toutiao.com/group/6801669716575257099/', 'title': '街拍格子衬衫+黑色束腰大衣，美女绽放迷人微笑', 'images': ['http://p9.pstatp.com/origin/pgc-image/08ab6c2fafb84551b6b9018a070bdfc3', 'http://p1.pstatp.com/origin/pgc-image/7878dfe8070a4922b2f41996745e3257', 'http://p3.pstatp.com/origin/pgc-image/a8402a23183d4cb7a67af9bf8e387c94', 'http://p3.pstatp.com/origin/pgc-image/d962686c0d3848abb28bf5f1c42dcfdd', 'http://p1.pstatp.com/origin/pgc-image/3b97d9f5b9bf4676968a89a7f01299f1', 'http://p3.pstatp.com/origin/pgc-image/91ec603752794b5b8d9d0c67e68eeb5d', 'http://p9.pstatp.com/origin/pgc-image/b401c7c025a04c17a4e99484330e32fb'], '_id': ObjectId('5e648f844d5a25526d8630f4')} 请求文章详情页出错 None 进程已结束，退出代码 0 代码贴上：import json import os from _md5 import md5 from urllib.parse import urlencode from bs4 import BeautifulSoup from requests.exceptions import RequestException import requests import re import pymongo MONGO_URL = 'localhost' MONGO_DB = 'toutiao_jiepai' MONGO_TABLE = 'jiepai' client = pymongo.MongoClient(MONGO_URL, connect=False) db = client[MONGO_DB] GROUP_STARST = 0 GROUP_END = 20 KEYWORD = '街拍' headers = { 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36', 'cookie': 'csrftoken=bf9266cc133025b21a5e4998ffd5ce35; tt_webid=6790686063313733134; UM_distinctid=1701fb35e91866-04c171aadb2013-b791b36-144000-1701fb35e9279a; ttcid=86d38a88812b421583147156ab016ec237; _ga=GA1.2.1866509185.1582287463; s_v_web_id=verify_k794o57o_YRKnMOhd_FUeV_4ZdI_Bpo2_3vXzw7x5Gx3a; __utma=24953151.1866509185.1582287463.1583116936.1583116936.1; __utmz=24953151.1583116936.1.1.utmcsr=mp.toutiao.com|utmccn=(referral)|utmcmd=referral|utmcct=/profile_v3/weitoutiao; __utmc=24953151; SLARDAR_WEB_ID=7b78defd-3070-4596-9123-59244140755e; passport_auth_status=0f792b07d1cc7e289d22eff873cc7c10%2C05d5a1d4bfea33adb46666e2ce9e3596; toutiao_sso_user=7da7c4fb85bcf55cc492a893a21d6251; sessionid=a915499f555249bdb4f3589e50930ec3; uid_tt=769f44a859173e5be80260a51aff7903; sid_tt=a915499f555249bdb4f3589e50930ec3; tt_scid=hu9kP-IprXVAhkiPwrxxRBJJFpnHByB.40Boc8LMWZxP.rmAnLe5H8ltCAKUsLk4032b; __tasessionId=tchl9rncq1583588525235; CNZZDATA1272960458=515500770-1581078898-%7C1583585464' } # 获得通过ajax请求返回的json数据 def get_page_index(offset, keyword): data = { 'aid': '24', 'app_name': 'web_search', 'offset': offset, 'format': 'json', 'keyword': keyword, 'autoload': 'true', 'count': '20', 'en_qc': '1', 'cur_tab': '1', 'from': 'search_tab', 'pd': 'synthesis', 'timestamp': '1583588896243' } url = 'https://www.toutiao.com/api/search/content/?' + urlencode(data) # https://www.toutiao.com/api/search/content/?aid=24&app_name=web_search # &offset=0&format=json&keyword=%E8%A1%97%E6%8B%8D&autoload=true&count=20 # &en_qc=1&cur_tab=1&from=search_tab&pd=synthesis&timestamp=1583588896243 try: response = requests.get(url, headers=headers) if response.status_code == 200: return response.text return None except RequestException: print("请求ajax出错") return None # 获得每篇文章的url def parse_page_index(html): data = json.loads(html) if data and 'data' in data.keys(): for item in data.get('data'): yield item.get('article_url') # 返回article_url # 获得文章详情页的源代码 def get_page_detail(url): try: response = requests.get(url, headers=headers) if response.status_code == 200: return response.text return None except RequestException: print("请求文章详情页出错", url) return None def parse_page_detail(html, url): soup = BeautifulSoup(html, 'lxml') images_pattern = re.compile('BASE_DATA.galleryInfo.*?gallery: JSON.parse\("(.*?)"\),', re.S) result = re.search(images_pattern, html) if result: title = soup.select('title')[0].get_text() # print(title) # print(result.group(1)) data = result.group(1).encode('utf-8').decode('unicode-escape') # 去掉\\\u002F，先用utf-8编码再用unicode-escape解码 data = json.loads(data) # 转换成json格式的字符串 if data and 'sub_images' in data.keys(): sub_images = data.get('sub_images') images = [item.get('url') for item in sub_images] for image in images: download_image(image, title) return { 'url': url, 'title': title, 'images': images } def download_image(url, title): try: response = requests.get(url, headers=headers) if response.status_code == 200: save_image(response.content, title) return None except RequestException: print("请求图片出错", url) return None def save_image(content, title): dir_name = title if not os.path.exists(dir_name): os.makedirs(dir_name) file_path = '{0}.{1}'.format(md5(content).hexdigest(), 'jpg') print('正在下载' + file_path) if not os.path.exists(file_path): with open(dir_name + '/' + file_path, 'wb') as f: f.write(content) f.close() def save_to_mongo(result): if db[MONGO_TABLE].insert(result): print("存储到MongoDB成功", result) return True return False def main(offset): html = get_page_index(offset, KEYWORD) # print(html) for url in parse_page_index(html): # print(url) html = get_page_detail(url) if html: result = parse_page_detail(html, url) # print(result) if result: save_to_mongo(result) if __name__ == '__main__': for offset in range(GROUP_STARST, GROUP_END + 1, 20): main(offset) 参考链接：https://www.cnblogs.com/YangARTuan/p/10591503.html