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. Advertisements

  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. Advertisements

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. Lin
    Replies:
    25
    Views:
    39,668
    taraval
    Feb 4, 2011
  2. Eli Criffield

    variable arguments, odd results

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

    Odd behavior with odd code

    Michael Speer, Feb 16, 2007, in forum: C Programming
    Replies:
    33
    Views:
    1,517
    Richard Heathfield
    Feb 18, 2007
  4. nick048

    The number is odd?

    nick048, Nov 2, 2006, in forum: C++
    Replies:
    28
    Views:
    883
    Frederick Gotham
    Nov 3, 2006
  5. Replies:
    8
    Views:
    410
    Richard
    Oct 5, 2007
  6. Replies:
    3
    Views:
    1,106
  7. Jay
    Replies:
    0
    Views:
    178
  8. oldyork90
    Replies:
    10
    Views:
    629
    Jorge
    Sep 27, 2008
Loading...