I am trying to write a Ruby script that would read a local HTML file, and insert some more HTML (basically a string) into it after a certain #divid.
I am kinda noob so please don't hesitate to put in some code here.
Thanks
...
I looked at a lot of tuts but this one seems to have got me where I am
controller
def index
require 'nokogiri'
doc = Nokogiri::XML(open("http://sports.yahoo.com/top/rss.xml"))
@links = doc.xpath('//item').map do |i|
{'title' => i.xpath('title'), 'link' => i.xpath('link'), 'description' => i.xpath('description...
I have a two line script that works nicely in ruby. I moved it to haml and getting the error
NameError at /
uninitialized constant Tilt::CompileSite::Nokogiri
the haml code:
%td
- @doc = Nokogiri::XML(File.open(file))
= @doc.xpath("//testsuite").each_with_index {|node,index| "#{index+1}. #{node.attributes["name"]...
Hello.
I`ve trouble on have a HTML document after onchange function by Nokogiri.
Of course, Mechanize lib can control that. but, sadly webpage which I want to control is jsp not HTML.
Generated HTML showes as belows :
form method = "post" name = "mysearchform"
<select id = "hall_no" name = "hall_no" onchange = "document.mysearchform....
I've successfully used ruby (1.8) and nokogiri's css parsing to pull out front facing data from web pages.
However I now need to pull out some data from a series of pages where the data is in the "meta" tags in the source code of the page.
One of the lines I need is the following:
<meta name="geo.position" content="35.667459;139.70625...
I have been successfully screen-scraping certain sites but have come across some very odd behavior with Nokogiri today on a certain site.
If I view the HTML source code pulled down by Nokogiri with the actual HTML scource code from the site on a certain pages it is truncated. Some pages work just fine and all the data is there and other...