As the title says, I have some DOM manipulation tasks. For example, I want: - Find all the H1 elements that are blue. - find all text in size 12px. - etc.
How can I do this with Rails?
Thanks..:)
Update
I did some research on extracting web page content based on this article-> http://www.springerlink.com/index/A65708XMUR9KN9EA.pdf
Summary of the step:
- -
HTML rails, Nokogiri.
XPath . h1 "" css- .
require 'nokogiri' require 'open-uri' doc = Nokogiri::HTML(open('http://www.stackoverflow.com')) doc.xpath('//h1/a[@class="blue"]').each do |link| puts link.content end
, dom, JavaScript JQuery. .
http://railscasts.com/episodes/190-screen-scraping-with-nokogiri
, -, ( , , , ..).
, , gecko .
, gecko, getComputedStyle, .
, Ruby on Rails , Rails - .
RubyGnome , , RubyGnome Gtk:: MozEmbed.