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
Install:
$ gem install google_ajax_crawler_phantomjs
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
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request