No commit activity in last 3 years
No release in over 3 years
Wraps PhantomJS headless browser into Ruby code and provides basic DOM operations like click and get the content.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.9.12.2
~> 10.1.0
~> 3.1.0

Runtime

~> 1.9.8.0
 Project Readme

PhantomRubyBrowser

Wraps PhantomJS headless browser into Ruby code and provides basic DOM operations like click and get the content.

Under development

Example

Print DOM of javascript rendered page

browser = PhantomRubyBrowser.new("http://google.com/analytics")
puts browser.content

Open page, click on a link and save DOM

browser = PhantomRubyBrowser.new("http://google.com/analytics")
puts browser.content_after_click('a.ga-button')

Command line example

$ irb
1.9.3-p547 :002 > require 'phantom_ruby_browser'
 => true
1.9.3-p547 :003 > browser = PhantomRubyBrowser.new("http://google.com/analytics")
 => #<PhantomRubyBrowser:0x00000001daf0d8 @location="http://google.com/analytics", @phantomjs=Phantomjs>
1.9.3-p547 :006 > browser.content
 => "<html class=\"google-js\" lang=\"cs\"><head>\n\n ..."

How does it work

License

Released under MIT license