Coder Social home page Coder Social logo

djytwy / pyspider Goto Github PK

View Code? Open in Web Editor NEW

This project forked from binux/pyspider

7.0 2.0 2.0 3.98 MB

使用puppeteer做动态网页抓取的pyspider

Home Page: http://docs.pyspider.org/

License: Apache License 2.0

Python 84.53% JavaScript 8.90% Lua 0.93% CSS 1.73% HTML 3.64% Dockerfile 0.28%

pyspider's Introduction

Introduction:

This is pyspider and add the chromeheadless (puppeteer) to crawl the web page.And now it stable operation for 3 months in production environment .

Note: When you install Puppeteer, it downloads a recent version of Chromium (~170MB Mac, ~282MB Linux, ~280MB Win) that is guaranteed to work with the API.

requirement:

nodejs >= v8 5.4

Usage:

git clone [email protected]:djytwy/pyspider.git

cd ./pyspider

npm install

pip install -r requirements.txt

python run.py

Any APIs in pyspider could be used normally in this project.

To control chromeheadless add some params in self.crawl: launch chromeheadless to crawl web page (fetch_type="chrome" or fetch_type="chromium"):

def on_start(self):
    self.crawl('http://www.example.org/', callback=self.callback,fetch_type="chrome")

device (string): this param can control chromeheadless launch in mobile devices(eg:"iphone 6"):

def on_start(self):
    self.crawl('http://www.example.org/', callback=self.callback,fetch_type="chrome",device="iphone 6")

headless(bool default false): this param can control chromeheadless whether launch in headless mode (tested only on Windows 10 and MacOS):

def on_start(self):
    self.crawl('http://www.example.org/', callback=self.callback,fetch_type="chrome",headless=False)

Waring: headless only use in debug mode and in visual browser(eg: windows 10 and MacOS) for product environment please set it false.And browser launch only once in pyspider.

pyspider's People

Contributors

beader avatar binux avatar bosbyj avatar chikafujiwara avatar dandan32 avatar djytwy avatar e-dorigatti avatar eiriksm avatar eromoe avatar exoticknight avatar hackty avatar hitjackma avatar hondajojo avatar ihipop avatar jonathanspeek avatar jxltom avatar kaito-kidd avatar laapsaap avatar littlezz avatar lushl9301 avatar machinewu avatar nicozhang avatar piglei avatar plusplus1 avatar sdvcrx avatar sunnylqm avatar tiancheng91 avatar volvofixthis avatar xyb avatar zhuangzhuang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

m-momomo yqzcabao

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.