Skip to content

PhantomJS driver for the google_ajax_crawler gem: Rack Middleware adhering to the Google Ajax Crawling Scheme, using a headless browser to render JS heavy pages and serve a dom snapshot of the rendered state to a requesting search engine.

License

Notifications You must be signed in to change notification settings

ChristopheBelpaire/google_ajax_crawler_phantomjs

Repository files navigation

GoogleAjaxCrawlerPhantomjs

Build Status

PhantomJS driver for the google_ajax_crawler gem: Rack Middleware adhering to the Google Ajax Crawling Scheme, using a headless browser to render JS heavy pages and serve a dom snapshot of the rendered state to a requesting search engine.

for more information check : https://github.com/benkitzelman/google-ajax-crawler

Installation

Install:

$ gem install google_ajax_crawler_phantomjs

Usage

In your config.ru

require 'google_ajax_crawler'

use GoogleAjaxCrawler::Crawler do |config|
  config.page_loaded_test = lambda {|driver| driver.page.evaluate_script('document.getElementById("loading") == null') }
  config.driver = GoogleAjaxCrawler::Drivers::Poltergeist
end

app = lambda {|env| [200, {'Content-Type' => 'text/plain'}, "b" ] }
run app

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

PhantomJS driver for the google_ajax_crawler gem: Rack Middleware adhering to the Google Ajax Crawling Scheme, using a headless browser to render JS heavy pages and serve a dom snapshot of the rendered state to a requesting search engine.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages