随笔分类 -  爬虫进阶

仅限于学习交流,请勿用于商业形式
摘要:直接上代码吧 中间件简单使用: # -*- coding: utf-8 -*- # Define here the models for your spider middleware # # See documentation in: # https://docs.scrapy.org/en/lat 阅读全文
posted @ 2021-05-09 12:16 Full-Stack~ 阅读(183) 评论(0) 推荐(0)
摘要:Scrapy框架的使用 - pySpider- 什么是框架? - 就是一个具有很强通用性且集成了很多功能的项目模板(可以被应用在各种需求中)- scrapy集成好的功能: - 高性能的数据解析操作(xpath) - 高性能的数据下载 - 高性能的持久化存储 - 中间件 - 全栈数据爬取操作 - 分布 阅读全文
posted @ 2021-05-09 11:45 Full-Stack~ 阅读(171) 评论(0) 推荐(0)
摘要:selenium基本操作(需要提前下载浏览器driver.exe) from selenium import webdriver from time import sleep bro = webdriver.Chrome(executable_path='chromedriver.exe') bro 阅读全文
posted @ 2021-05-09 11:38 Full-Stack~ 阅读(85) 评论(0) 推荐(0)
摘要:基于Flask的示例 Server端 from flask import Flask,render_template import time app = Flask(__name__) @app.route('/bobo') def index_bobo(): time.sleep(2) retur 阅读全文
posted @ 2021-05-09 11:26 Full-Stack~ 阅读(89) 评论(0) 推荐(0)
摘要:HttpConnectinPool: 原因: 1.短时间内发起了高频的请求导致ip被禁 2.http连接池中的连接资源被耗尽 解决: 1.代理 2.headers中加入Conection:“close” 代理:代理服务器,可以接受请求然后将其转发。 匿名度 高匿:啥也不知道 匿名:知道你使用了代理, 阅读全文
posted @ 2021-05-09 11:22 Full-Stack~ 阅读(315) 评论(0) 推荐(0)
摘要:直接上代码 #如何爬取图片 url = 'https://pic.qiushibaike.com/system/pictures/12223/122231866/medium/IZ3H2HQN8W52V135.jpg' img_data = requests.get(url,headers=head 阅读全文
posted @ 2021-05-09 11:13 Full-Stack~ 阅读(180) 评论(0) 推荐(0)
摘要:import requests url = 'https://movie.douban.com/j/chart/top_list' start = input('您想从第几部电影开始获取:') limit = input('您想获取多少电影数据:') dic = { 'type': '13', 'i 阅读全文
posted @ 2021-05-09 11:03 Full-Stack~ 阅读(59) 评论(0) 推荐(0)
摘要:request简单使用 #爬取搜狗首页的页面源码数据import requests#1.指定urlurl = 'https://www.sogou.com/'#2.请求发送get:get返回值是一个响应对象response = requests.get(url=url)#3.获取响应数据page_t 阅读全文
posted @ 2021-05-09 10:49 Full-Stack~ 阅读(120) 评论(0) 推荐(0)
摘要:代码(仅限用于学习交流,未经允许不得用于商业获取非法利益): import requests from bs4 import BeautifulSoup import time import csv def get_url(start_num,end_num): url_list = [] #建立一 阅读全文
posted @ 2021-05-09 10:12 Full-Stack~ 阅读(340) 评论(0) 推荐(0)