Python
文章平均质量分 81
栗子ma
这个作者很懒,什么都没留下…
展开
-
【Python】解决matplotlib图例中文乱码问题——win10版本
1. 找到matplotlib 配置文件:import matplotlibprint(matplotlib.matplotlib_fname())E:\software\python\anaconda\lib\site-packages\matplotlib\mpl-data\matplotlibrc2. 编辑上述文件,uncomment the following 2 lines...原创 2018-07-17 15:15:03 · 1628 阅读 · 0 评论 -
【爬虫】Scrapy Feed Exports
【原文链接】https://doc.scrapy.org/en/latest/topics/feed-exports.html#topics-feed-exports Feed exportsNew in version 0.10.One of the most frequently required features when implementing scrapers is b...翻译 2018-07-31 15:21:59 · 402 阅读 · 0 评论 -
【爬虫】Scrapy Item Pipeline
【原文链接】https://doc.scrapy.org/en/latest/topics/item-pipeline.html 爬虫爬取了一个 item 后, 它会被发送到 Item Pipeline, which 通过好几个组件 that are executed sequentially 处理 item.每个 item 管道组件 (sometimes referred as ju...翻译 2018-07-31 13:48:37 · 232 阅读 · 0 评论 -
【爬虫】Scrapy Item
【原文链接】https://doc.scrapy.org/en/latest/topics/items.html ItemsThe main goal in scraping is to extract structured data from unstructured sources, typically, web pages. Scrapy spiders can return t...翻译 2018-07-31 10:05:28 · 227 阅读 · 0 评论 -
【爬虫】Scrapy 自定义下载器中间件
【原文链接】https://doc.scrapy.org/en/latest/topics/downloader-middleware.html Writing your own downloader middlewareEach middleware component is a Python class that defines one or more of the followi...翻译 2018-07-27 15:46:18 · 1270 阅读 · 0 评论 -
【爬虫】Scrapy 抓取网站数据
【原文链接】http://chenqx.github.io/2014/11/09/Scrapy-Tutorial-for-BBSSpider/ Scrapy Tutorial 接下来以爬取饮水思源BBS数据为例来讲述爬取过程,详见 bbsdmoz代码。 本篇教程中将带您完成下列任务:1. 创建一个Scrapy项目2. 定义提取的Item3. 编写爬取网站的 spider...转载 2018-07-20 15:50:23 · 2519 阅读 · 0 评论 -
【爬虫】使用 Python Scrapy 爬取静态网页中所有文字
Creating a projectBefore you start scraping, you will have to set up a new Scrapy project. Enter a directory where you’d like to store your code and run:scrapy startproject URLCrawlerOur first ...原创 2018-07-20 10:52:56 · 5906 阅读 · 0 评论 -
【爬虫】使用 Scrapy + Selenium 爬取动态加载页面的内容
上一篇文章里面我们使用 Python Scrapy 爬取静态网页中所有文字:https://blog.csdn.net/sinat_40431164/article/details/81102476但是有个问题,当我们把要访问的URL修改为:http://club.haval.com.cn/forum.php?mod=toutiao&mobile=2的时候,可以发现爬取的内容里面没有“...原创 2018-07-25 12:15:16 · 7166 阅读 · 0 评论 -
【爬虫】Scrapy配合Selenium爬取京东动态加载的商品信息
【原文链接】https://www.cnblogs.com/cnkai/p/7570116.html 在之前的一篇实战之中,我们已经爬取过京东商城的数据,但是前面的那一篇其实是有一个缺陷的,不知道你看出来没有,下面就来详细的说明和解决这个缺陷。我们在京东搜索页面输入关键字进行搜索的时候,页面的返回过程是这样的,它首先会直接返回一个静态的页面,页面的商品信息大致是30个,之所以说是大致,...转载 2018-07-24 18:17:23 · 2252 阅读 · 2 评论 -
【爬虫】Python Scrapy 基础概念 —— 请求和响应
【原文链接】https://doc.scrapy.org/en/latest/topics/request-response.html Scrapy uses Request and Response 对象来爬网页.Typically, spiders 中会产生 Request 对象,然后传递 across the system, 直到他们到达 Downloader, which 执...翻译 2018-07-24 16:08:27 · 977 阅读 · 0 评论 -
【爬虫】Python Scrapy Selectors (选择器)
【原文链接】https://doc.scrapy.org/en/latest/topics/selectors.html#topics-selectors When you’re scraping web pages, the most common task you need to perform is to extract data from the HTML source. Ther...翻译 2018-07-19 14:01:57 · 1044 阅读 · 0 评论 -
【NLP】Python中文文本聚类
1. 准备需要进行聚类的文本,这里选取了10篇微博。import ospath = 'E:/work/@@@@/开发事宜/大数据平台/5. 标签设计/文本测试数据/微博/'titles = []files = []for filename in os.listdir(path): titles.append(filename) #带BOM的utf-8编码的txt文件时...原创 2018-07-18 10:08:50 · 22074 阅读 · 12 评论 -
【爬虫】selenium-python 安装和入门
【原文链接】http://selenium-python.readthedocs.io/installation.html【原文链接】http://selenium-python.readthedocs.io/getting-started.html 1. Installation1.1. IntroductionSelenium Python bindings provide...翻译 2018-07-23 14:10:10 · 345 阅读 · 0 评论 -
【爬虫】Scrapy 爬取excel中500个网址首页,使用Selenium模仿用户浏览器访问,将网页title、url、文本内容组成的item保存至json文件
创建含有网址首页的excel文件host_tag_网站名称_主域名_子域名.xlsx编辑读取excel文件的工具类项目FileUtils新建项目FileUtils编辑file_utils.py# -*- coding: utf-8 -*-"""Created on Thu Jul 26 10:42:49 2018@author: Administrator"...原创 2018-08-01 14:09:44 · 3601 阅读 · 0 评论