search for: nokogiri

Displaying 20 results from an estimated 90 matches for "nokogiri".

2009 Oct 21
4
XML file using Nokogiri gem
Hello friends, Can you guys give me some idea about how to Create XML file using Nokogiri gem. -- Posted via http://www.ruby-forum.com/.
2009 Oct 13
9
Nokogiri: to_s WITHOUT html surrounding's tags?
Hi all n = Nokogiri::HTML("<h1>H1</h1>") n.to_s # => <!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">\n<html><body><h1>H1</h1></body></html> Is there a method that only...
2009 Sep 17
1
Load Error Using Mechanize Gem
Hi, I''m getting a "Could not open any of [xml2, xslt, exslt] (LoadError)" error when trying to run a simple Ruby program taken from the EXAMPLES.rdoc file of the Mechanize gem. The error is in this line of the Nokogiri module of libxml.rb: ffi_lib ''xml2'', ''xslt'', ''exslt'' Not sure if there are missing gems, and if so, what to install. Any ideas how to fix this? Thanks very much. Gary M. Program -- main.rb: ---------------------- ## Google require ...
2013 Sep 02
2
Why the string interpolation is not working inside the Nokogiri method `#search` ?
Why the string interpolation is not working inside the Nokogiri method `#search` ? require ''nokogiri'' doc = Nokogiri::HTML::Document.parse <<-eotl <div> <p>foo</p> <p>foo</p> <p>bar</p> </div> eotl doc.class # => Nokogiri::HTML::Document class Person attr_accessor :name end...
2009 Nov 11
2
nokogiri: parsing tags
Hello, I''m trying to use nokogiri gem to parse individual xhtml tags (not the whole html document) and preform some processing on them. Heres an example of a string that I want to process: str = ''<img src="http://www.canadascapital.gc.ca/data/2/rec_imgs/5005_Pepsi_H1NB.gif"/> some text<a href="#&q...
2010 Jun 10
0
strange problem:no such file to load -- nokogiri on rails3
I am test the script named test.rb by command "ruby test.rb" and it pass. Then i converte it as rake task. The rake task pass on rails 2.3.4 but fail on rails 3 beta4 with error msg: "no such file to load -- nokogiri" ============================ env :rails 3 beta4, ruby 1.8.7, ubuntu ============================ test.rb ============================ require ''rubygems'' require ''nokogiri'' require ''open-uri'' require "iconv" url = "http:...
2011 Dec 05
12
Using nokogiri
HI, I want to grab some information about university names, and I found this term called "web scraping" I search about it in google, and there are tools in ruby. One of them is nokogiri but I''m a bit confused because it seems that it only gets information that its already in an html or xml I found a webpage that have a list of university names as a <select> </select> (html label) and I want to grab that information The question is... can I do that with nok...
2013 Jun 04
3
Nokogiri::XML methods example
Hi, I am not able to find out a simple example to find out the how the method works: > Nokogiri::XML::EntityReference::new (http://nokogiri.org/Nokogiri/XML/EntityReference.html#method-c-new) > Nokogiri::XML::Document#canonicalize (http://nokogiri.org/Nokogiri/XML/Document.html#method-i-canonicalize) Thanks -- Posted via http://www.ruby-forum.com/. -- You received this message becaus...
2010 Nov 20
4
How to get rspec running?
...ing arel (1.0.1) Using activerecord (3.0.1) Using activeresource (3.0.1) Using annotate-models (1.0.4) Using bundler (1.0.3) Using diff-lcs (1.1.2) Using factory_girl (1.3.2) Using thor (0.14.4) Using railties (3.0.1) Using rails (3.0.1) Using factory_girl_rails (1.0) Using faker (0.3.1) Installing nokogiri (1.4.4) Using rspec-core (2.0.1) Using rspec-expectations (2.0.1) Using rspec-mocks (2.0.1) Using rspec (2.0.1) Using rspec-rails (2.0.1) Using sqlite3-ruby (1.3.2) Using webrat (0.7.1) Using will_paginate (3.0.pre2) Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is...
2010 Oct 31
0
Loading xml document using Nokogiri and retrieving CDATA element
This is an extension of my last post (problems with REXML) which has me looking to Nokogiri again. The reason I am not using Nokogiri is I can not seem to find a way to get CDATA out of a Nokogiri document. First, can you tell me if I am loading my document correctly, because when I call my_document.to_xml, I only get one line back: (rdb:1) test_file = Nokogiri::XML(mismo_xml_file) #&lt...
2009 Jul 26
3
Failed to build gem native extension
On Sat, Jul 25, 2009 at 9:14 PM, Jeffrey Roberts<jeffrey.l.roberts at gmail.com> wrote: > Hello all, I have looked up and down on google for a solution to this going > on several days now, I am really hoping someone here can help me out. > > I have all my deps in order, and I believe the error is that it is looking > in /usr/lib when it should be looking in /usr/lib64, I am
2009 Jan 24
4
nokogiri selector help
hiya, i want the selector that would return a <tr> of a table if any td contains some text, so i can use it in click_link_within e.g. When I click the "show" link within the row containing "user at example.com" When /^I click the "(.+)" link within the row containing "(.+)"$/ do | link, text| selector = ?? click_link_within selector, link
2013 Jun 29
2
how to remove nokogiri warning message
hi I always get this message today WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.9.0 I googled by all solution is for mac, I am use linux(openSUSE 12.3) any one can help? thanks in advance -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. T...
2010 Jan 08
7
input form fields not in the #<WWW::Mechanize::Form array
Hi This may be a dumb question with an obvious answer. It would seem that an input form field identified with an ''id'' qualifier and not with a ''name'' qualifier is not recognised by Mechanize - at least it isn''t in the form field list. Is there any way of getting at these elements or am I, as I suspect, fresh out of luck. But you never know ...
2013 Jun 18
2
`require': cannot load such file -- nokogiri (LoadError) in rubyXL
...XL::Parser.parse("test.xlsx") workbook = RubyXL::Workbook.new sheet_Name = workbook.worksheets[0] puts sheet_Name * * * *ERROR* rubyXL.rb /usr/local/Cellar/ruby/2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in *`require'': cannot load such file -- nokogiri (LoadError)* from /usr/local/Cellar/ruby/2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'' from /Users/mselv2/.rvm/gems/ruby-1.8.7-p371/gems/rubyXL-1.2.10/lib/rubyXL/writer/content_types_writer.rb:6:in `<top (required)>'' from /usr/l...
2013 Sep 18
1
Cloud provisionner on CentOS 6 issue
...oner) Then I did : export RUBYLIB=/etc/puppet/modules/cloud_provisioner/lib:$RUBYLIB After this, PuppetLabs suggests to test if the installation worked fine by executing : # puppet help node_aws Here is the result : [root@poste403 ~]# puppet help node_aws /usr/local/rvm/gems/ruby-1.9.2-p320/gems/nokogiri-1.6.0/lib/nokogiri/nokogiri.so: [BUG] Segmentation fault ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux] Abandon (core dumped) I really don''t understand why this. If anyone encountered this problem before, thanks for help. Vincent -- You received this message because you are subs...
2009 Aug 24
5
extract keywords from string
hi - i have strings that i need to extract keywords from. the string might have html tags, urls, etc. i need to extract the keywords from the string. i imagine i''m not the first guy to have to tackle this problem. is there a gem i can use or anyone have any ideas how to approach this? thanks, dino
2011 Feb 20
7
Using Nokogiri to insert a <span> tag into existing text
All, I''m using Nokogiri to handle the following problem: I have a piece of HTML, and for certain text nodes, I need to insert <span> tags into the text of these nodes at a certain place. What I am doing is finding the place where I want to insert the <span>, let''s say index X of the text node'...
2011 Jan 06
1
Invalid argument - https://graph.facebook.com/19292868552
...= Hpricot(open("http://graph.facebook.com/226723089703")) @doc = doc.to_s.gsub(/"id.+?likes":/,"").gsub("{","").gsub("}","") puts @doc OR require ''rubygems'' require ''nokogiri'' require ''open-uri'' # Get a Nokogiri::HTML:Document for the page we’re interested in... doc = Nokogiri::HTML(open(''https://graph.facebook.com/19292868552'')) puts doc These two .rb files working fine on my local but giving error " Invalid argument -...
2011 Nov 27
2
problem scraping using nokogiri - getting wrong characters
Hi all, I am scraping a table off of another site and inserting it onto my site. you can see an example on the initial page at: http://mthosts.heroku.com. I''m referring to the green box with the snowbird weather and snowfall information. this box has been scraped off of the snowbird site at: http://www.snowbird.com/ski_board/snowreport.php The problem is that on the snowbird site it