Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > odd number of arguments in Nokogiri

Reply
Thread Tools

odd number of arguments in Nokogiri

 
 
Vikas Maskeri
Guest
Posts: n/a
 
      05-05-2009
Hi, I am using Nokogiri for parsing HTML pages.
The gem parses the tags properly only if the tags are properly closed
and also if the attributes are syntacticaly proper. But there seems to
be an issue with parsing if the tags are not properly complete.
For example, in an iframe tag, if the 'height' attribute is present but
no value is written for it, then an error occurs saying that "odd number
of arguments for hash".
Please suggest a solution for this problem.
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Srijayanth Sridhar
Guest
Posts: n/a
 
      05-05-2009
[Note: parts of this message were removed to make it a legal post.]

Have you tried using Nokogiri.Hpricot(open(some_url)) ?

I've had the same problem on several sites wrt Nokogiri. I have had to use
Hpricot for sites with irregular HTML/XML. Its a pity since Nokogiri IS
faster.

Jayanth

On Tue, May 5, 2009 at 12:15 PM, Vikas Maskeri
<(E-Mail Removed)>wrote:

> Hi, I am using Nokogiri for parsing HTML pages.
> The gem parses the tags properly only if the tags are properly closed
> and also if the attributes are syntacticaly proper. But there seems to
> be an issue with parsing if the tags are not properly complete.
> For example, in an iframe tag, if the 'height' attribute is present but
> no value is written for it, then an error occurs saying that "odd number
> of arguments for hash".
> Please suggest a solution for this problem.
> --
> Posted via http://www.ruby-forum.com/.
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Call again a variadic function (... variable number of arguments)with same arguments that its variadic wrapper moreau.steve@gmail.com C Programming 3 12-31-2008 07:13 AM
functions and arguments.length; passing unknown number of arguments oldyork90 Javascript 10 09-27-2008 03:05 AM
PLEASE HELP - Odd problem passing function arguments cpptutor2000@yahoo.com C Programming 8 10-05-2007 10:30 PM
Odd behavior with odd code Michael Speer C Programming 33 02-18-2007 07:31 AM
variable arguments, odd results Eli Criffield C Programming 3 06-14-2005 02:51 PM



Advertisments