All Projects → zhshch2002 → gospider

zhshch2002 / gospider

Licence: Apache-2.0 license
⚡ Light weight Golang spider framework | 轻量的 Golang 爬虫框架

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to gospider

gathertool
gathertool是golang脚本化开发库,目的是提高对应场景程序开发的效率;轻量级爬虫库,接口测试&压力测试库,DB操作库等。
Stars: ✭ 36 (-80.33%)
Mutual labels:  spider, crawl, spider-framework
Zhihu Login
知乎模拟登录,支持提取验证码和保存 Cookies
Stars: ✭ 340 (+85.79%)
Mutual labels:  spider, crawl
Geetest
geetest,滑动验证码
Stars: ✭ 293 (+60.11%)
Mutual labels:  spider, crawl
Grab Site
The archivist's web crawler: WARC output, dashboard for all crawls, dynamic ignore patterns
Stars: ✭ 680 (+271.58%)
Mutual labels:  spider, crawl
go-movies
golang spider Crawler 爬虫 电影
Stars: ✭ 168 (-8.2%)
Mutual labels:  spider, colly
wget-lua
Wget-AT is a modern Wget with Lua hooks, Zstandard (+dictionary) WARC compression and URL-agnostic deduplication.
Stars: ✭ 52 (-71.58%)
Mutual labels:  spider, crawl
Infospider
INFO-SPIDER 是一个集众多数据源于一身的爬虫工具箱🧰,旨在安全快捷的帮助用户拿回自己的数据,工具代码开源,流程透明。支持数据源包括GitHub、QQ邮箱、网易邮箱、阿里邮箱、新浪邮箱、Hotmail邮箱、Outlook邮箱、京东、淘宝、支付宝、中国移动、中国联通、中国电信、知乎、哔哩哔哩、网易云音乐、QQ好友、QQ群、生成朋友圈相册、浏览器浏览历史、12306、博客园、CSDN博客、开源中国博客、简书。
Stars: ✭ 5,984 (+3169.95%)
Mutual labels:  spider, crawl
Fbcrawl
A Facebook crawler
Stars: ✭ 536 (+192.9%)
Mutual labels:  spider, crawl
Novel Plus
小说精品屋-plus是一个多端(PC、WAP)阅读、功能完善的原创文学CMS系统,由前台门户系统、作家后台管理系统、平台后台管理系统、爬虫管理系统等多个子系统构成,支持多模版、会员充值、订阅模式、新闻发布和实时统计报表等功能,新书自动入库,老书自动更新。
Stars: ✭ 1,122 (+513.11%)
Mutual labels:  spider, crawl
Pspider
一个简单的分布式爬虫框架
Stars: ✭ 102 (-44.26%)
Mutual labels:  spider, crawl
Geetest
滑动验证码,希望对你们有所帮助❤️
Stars: ✭ 114 (-37.7%)
Mutual labels:  spider, crawl
fetchurls
A bash script to spider a site, follow links, and fetch urls (with built-in filtering) into a generated text file.
Stars: ✭ 97 (-46.99%)
Mutual labels:  spider, crawl
Proxy pool
Python爬虫代理IP池(proxy pool)
Stars: ✭ 13,964 (+7530.6%)
Mutual labels:  spider, crawl
Scrapy IPProxyPool
免费 IP 代理池。Scrapy 爬虫框架插件
Stars: ✭ 100 (-45.36%)
Mutual labels:  spider, crawl
crawler-chrome-extensions
爬虫工程师常用的 Chrome 插件 | Chrome extensions used by crawler developer
Stars: ✭ 53 (-71.04%)
Mutual labels:  spider, crawl
Nodespider
[DEPRECATED] Simple, flexible, delightful web crawler/spider package
Stars: ✭ 33 (-81.97%)
Mutual labels:  spider, crawl
Python3 Spider
Python爬虫实战 - 模拟登陆各大网站 包含但不限于:滑块验证、拼多多、美团、百度、bilibili、大众点评、淘宝,如果喜欢请start ❤️
Stars: ✭ 2,129 (+1063.39%)
Mutual labels:  spider, crawl
Crack Js Spider
破解JS反爬虫加密参数,已破解中国裁判文书网(2020-06-30更新),淘宝密码,天安保险登录,b站登录,房天下登录,WPS登录,微博登录,有道翻译,网易登录,微信公众号登录,空中网登录,今目标登录,学生信息管理系统登录,共赢金融登录,重庆科技资源共享平台登录,网易云音乐下载,一键解析视频链接,财联社登录。
Stars: ✭ 175 (-4.37%)
Mutual labels:  spider, crawl
python-spider
零基础学习python爬虫
Stars: ✭ 31 (-83.06%)
Mutual labels:  spider
ben-ben-spider
犇犇爬虫
Stars: ✭ 36 (-80.33%)
Mutual labels:  spider

Gospider

gopkg goproxycn Go Test codecov

Gospider 使用文档

Gospider是一个轻量友好的的Go爬虫框架。

Gospider在管理网络请求方面使用了Goreq‌这样分割项目使功能划分更加明确,Gospider负责管理调度任务,Goreq负责处理网络请求。Gospider中的goreq.Requestgoreq.Responsegoreq.ClientGoreq提供。

🚀 Feature

  • 优雅的 API
  • 便于组织具有复杂层级和逻辑的代码
  • 友善的分布式支持
  • 一些细节 相对链接自动转换、字符编码自动解码、HTML/JSON 自动解析
  • 丰富的扩展支持 自动去重、失败重试、记录异常请求、控制延时、随机延时、并发、速率、Robots.txt 支持、随机 UA
  • 轻量 适于学习或快速开箱搭建

网络请求

go get -u github.com/zhshch2002/goreq

Gospider依赖Goreq描述、完成网络请求,这是一个Goreq的简单演示,如需更多资料请查阅Goreq GitHub repo或者使用文档

fmt.Println(goreq.Get("https://httpbin.org/get").AddParam("A","a").Do().Txt())

结果是:

{
  "args": {
    "A": "a"
  }, 
  "headers": {
    "Accept-Encoding": "gzip", 
    "Host": "httpbin.org", 
    "User-Agent": "Go-http-client/2.0", 
    "X-Amzn-Trace-Id": "Root=1-6017ae9d-109027b5452abdd849d0161b"
  }, 
  "origin": "221.219.65.152", 
  "url": "https://httpbin.org/get?A=a"
}

此外:

  • resp.Resp() (*Response, error) 获取响应本身以及网络请求错误。
  • resp.Txt() (string, error) 自动处理完编码并解析为文本后的内容以及网络请求错误。
  • resp.HTML() (*goquery.Document, error)解析为HTML
  • resp.XML() (*xmlpath.Node, error)解析为XML
  • resp.BindXML(i interface{}) error将XML绑定到struct
  • resp.JSON() (gjson.Result, error)解析为JSON
  • resp.BindJSON(i interface{}) error将Json绑定到struct
  • resp.Error() error 网络请求错误。(正常情况下为nil

Goreq可以设置中间件、更换Http Client。请见Goreq 使用文档

快速开始

go get -u github.com/zhshch2002/gospider

第一个例子:

package main

import (
	"github.com/zhshch2002/goreq"
	"github.com/zhshch2002/gospider"
)

func main() {
	s := gospider.NewSpider() // create spider

	s.OnResp(func(t *gospider.Task) {
		t.Println("this callback will process all response")
	})

	s.OnItem(func(t *gospider.Task, i interface{}) interface{} { // collect and save crawl result
		t.Println(i)
		return i
	})

	s.AddRootTask(
		goreq.Get("https://httpbin.org/get"),
		func(t *gospider.Task) { // this callback will only handle this request
			t.AddItem(t.Text) // submit result into OnItem pipeline
		},
	)

	s.Wait()
}

这是一个简单的爬虫,向https://httpbin.org/get发送请求并将结果作为Item存入SpiderGospider会异步处理OnItem结果,不阻塞爬虫进程。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].