1 Star 0 Fork 15

haohailuo / surfer

forked from andeyalee / surfer 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

surfer GoDoc GitHub release

A high level concurrency downloader.

surfer是一款Go语言编写的高并发 web 下载器,拥有surf与phantom两种下载内核。 支持固定UserAgent自动保存cookie与随机大量UserAgent禁用cookie两种模式,高度模拟浏览器行为,可实现模拟登录等功能。 高并发爬虫[Pholcus](https://github.com/henrylee2cn/pholcus)的专用下载器。(官方QQ群:Go大数据 42731170,欢迎加入我们的讨论)

Usage

package main

import (
    "github.com/henrylee2cn/surfer"
    "io/ioutil"
    "log"
)

func main() {
    // 默认使用surf内核下载
    resp, err := surfer.Download(&surfer.DefaultRequest{
        Url: "http://github.com/henrylee2cn/surfer",
    })
    if err != nil {
        log.Fatal(err)
    }
    b, err := ioutil.ReadAll(resp.Body)
    log.Println(string(b), err)

    // 指定使用phantomjs内核下载
    resp, err = surfer.Download(&surfer.DefaultRequest{
        Url:          "http://github.com/henrylee2cn",
        DownloaderID: 1,
    })
    if err != nil {
        log.Fatal(err)
    }
    b, err = ioutil.ReadAll(resp.Body)
    log.Println(string(b), err)

    resp.Body.Close()
    surfer.DestroyJsFiles()
}

详情参考:example.go

 

开源协议

surfer 项目采用商业应用友好的Apache License v2.发布

Copyright 2015 henrylee2cn Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

surfer [high level concurrency downloader] 是一款Go语言编写的高并发爬虫下载器,拥有surf与phantom两种下载内核,支持固定UserAgent自动保存cookie与随机大量UserAgent禁用cookie两种模式,高度模拟浏览器行为,可实现模拟登录等功能。 展开 收起
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/laurence/surfer.git
git@gitee.com:laurence/surfer.git
laurence
surfer
surfer
master

搜索帮助