GithubHelp home page GithubHelp logo

avosun / serps-cli Goto Github PK

View Code? Open in Web Editor NEW

This project forked from serp-spider/serps-cli

0.0 1.0 0.0 23 KB

:spider: Scrape search engines from the terminal

Home Page: https://serp-spider.github.io/

License: Other

PHP 93.80% Shell 6.20%

serps-cli's Introduction

SERPS cli

Command line utility to scrape from the terminal

Install

You can install it globally with composer:

composer global require serps/cli

Test installation by invoking the help message

serps help

Google

Search

Search command allows to trigger a google search from the command line

serps google:search "keyword"

example

    $ serps google:search "github"
    {
      "natural-results": [
        {
          "url": "https://github.com/",
          "title": "How people build software · GitHub",
          "types": [
            "classical",
            "classical_large"
          ]
        },
        {
          "url": "https://fr.wikipedia.org/wiki/GitHub",
          "title": "GitHubWikipédia",
          "types": [
            "classical"
          ]
        },
        {
          "url": "https://en.wikipedia.org/wiki/GitHub",
          "title": "GitHub - Wikipedia, the free encyclopedia",
          "types": [
            "classical"
          ]
        },
        {
          "url": "http://rue89.nouvelobs.com/2015/03/31/quest-tous-les-techos-monde-font-github-258439",
          "title": "Qu'est-ce que tous les techos du monde font sur GitHub ? - Rue89 - L ...",
          "types": [
            "classical"
          ]
        },
        {
          "url": "https://twitter.com/github?lang=fr",
          "title": "GitHub (@github) | Twitter",
          "types": [
            "classical"
          ]
        },
        {
          "url": "https://www.githubarchive.org/",
          "title": "GitHub Archive",
          "types": [
            "classical"
          ]
        },
        {
          "url": "https://wiki.jenkins-ci.org/display/JENKINS/GitHub+Plugin",
          "title": "GitHub Plugin - Jenkins - Jenkins Wiki",
          "types": [
            "classical"
          ]
        }
      ],
      "total-count": 1.31e+08,
      "natural-results-count": 7,
      "evaluated": true,
      "http-client": "curl",
      "url": "https://www.google.fr/search?q=github&gws_rd=cr&ei=kH7OV7LaForeU_yGhtgC",
      "initial-url": "https://google.com/search?q=github"
    }

Tip: In the example jq helped to pretty format the outputted json: $ serps google:search "github" | jq '.'

Advanced usage

    $ serps google:search --tld="co.uk" --lr="lang_es" "some keywords" phantomjs

With proxy:

    $ serps google:search --proxy="http://proxy:8080" "some keywords"

Page and result per page:

    $ serps google:search --page=2 --res-per-page=20 "some keywords"

User Ageng:

    $ serps google:search --user-agent="..." "some keywords"

Dump page in a file:

In a addition of printing the results you can save the dom in a file

    $ serps google:search --dump="/path/to/file.html" "some keywords"

By default the dump option wont be able to process if the file you specify already exists. The option force-dump makes it able to override an existing file:

    $ serps google:search --dump="/path/to/file.html" --force-dump=true "some keywords"

Read and parse a html google file saved locally instead of doing http query

    $ serps google:search --file=./google--search-file.html "some keywords"

serps-cli's People

Contributors

gsouf avatar

Watchers

James Cloos avatar

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.