pyspider网站地址:http://docs.pyspider.org/en/latest/。文档比较好,安装起来也非常方便。既然是基于python的框架,那么首先得安装python。微软出的一款编辑软件VSCode,运行速度快,提供了丰富的插件,本人用它安装了python的插件,学习python。

我分别在Linux、window上都安装过pyspider,window上貌似有问题。以下是我改写的一段代码:

#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Created on 2018-04-18 07:17:21
# Project: emeraldinsight from pyspider.libs.base_handler import * class Handler(BaseHandler):
crawl_config = {
} @every(minutes=24 * 60)
def on_start(self):
self.crawl('https://www.emeraldinsight.com/action/doSearch?AllField=computer&content=articlesChapters', callback=self.index_page) @config(age=10 * 24 * 60 * 60)
def index_page(self, response): for each in response.doc('.hlFld-Title a').items():
self.crawl(each.attr.href, callback=self.list_page) @config(priority=2)
def list_page(self, response): downloadurl='https://www.emeraldinsight.com/action/downloadCitation' detailUrl=response.url print '详细地址:'+detailUrl doi=detailUrl.replace('https://www.emeraldinsight.com/doi/full/','') print 'doi:'+doi postdata={ 'doi':doi,
'format':'bibtex'
} self.crawl(downloadurl,callback=self.detail_page,method='POST',data=postdata) @config(priority=2)
def detail_page(self, response):
print response.text

这个简单的例子中包含有Get、Post请求以及对文档解析,它采用的是PQuery和JQuery的语法类似,所以上手特别快,几乎不用学习。

此框架提供了任务调度、队列、文档解析、web端图形化的界面等。

最新文章

  1. Mac上的软件使用介绍
  2. git revert 用法
  3. Tomcat性能调优-让小猫飞奔[转]
  4. nginx配置(解释)
  5. AIZU 0005
  6. javascript:void到底是个什么?
  7. 浏览器扩展系列————异步可插入协议(pluggable protocol)的实现
  8. Xcode 设置文件生成时的模板
  9. 一个想法照进现实-《IT连》创业项目:聊聊最近两三事
  10. git 添加管理成员
  11. 小程序之带参数跳转到tab页
  12. 切记!pycharm向mysql数据库添加数据过程
  13. SpringBoot 集成 Mybatis 使用 Druid数据源 MySQL数据库
  14. Python练习-生成器-一个生成器被坑的体无完肤
  15. win8自带输入法如何切换全角、半角操作流程
  16. 前端虚拟接口mockjs的使用
  17. mvc权限验证--AuthorizeAttribute
  18. MVC软件设计模式
  19. _heap_alloc_base 奔溃,奔溃原因:堆被破坏
  20. 【机器学习】推荐系统、SVD分解降维

热门文章

  1. octotree神器 For Github and GitLab 火狐插件
  2. mybatis使用注意的细节
  3. 【HackerRank】Coin on the Table
  4. 常用模块----time&random&hushlib&os
  5. Python编程-面向对象和类
  6. scope 作用域
  7. centos_mysql5.6.35_rpm安装
  8. Excel下载打不开
  9. JavaWeb基础
  10. how to use Inspector in fiddler