odd number of arguments in Nokogiri

Discussion in 'Ruby' started by Vikas Maskeri, May 5, 2009.

  1. 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/.
    Vikas Maskeri, May 5, 2009
    #1
    1. Advertising

  2. [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
    <>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/.
    >
    >
    Srijayanth Sridhar, May 5, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eli Criffield

    variable arguments, odd results

    Eli Criffield, Jun 13, 2005, in forum: C Programming
    Replies:
    3
    Views:
    326
    Eli Criffield
    Jun 14, 2005
  2. Michael Speer

    Odd behavior with odd code

    Michael Speer, Feb 16, 2007, in forum: C Programming
    Replies:
    33
    Views:
    1,062
    Richard Heathfield
    Feb 18, 2007
  3. Replies:
    8
    Views:
    312
    Richard
    Oct 5, 2007
  4. Replies:
    3
    Views:
    800
  5. oldyork90
    Replies:
    10
    Views:
    334
    Jorge
    Sep 27, 2008
Loading...

Share This Page