# Odd number of arguments in Nokogiri

**URL:** <https://www.ruby-forum.com/t/odd-number-of-arguments-in-nokogiri/167188>\
**Category:** Ruby\
**Created:** [May 5, 2009, 8:45am UTC](https://www.ruby-forum.com/t/odd-number-of-arguments-in-nokogiri/167188 "2009-05-05T08:45:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikasmaskeri](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/6f9a4e/32.png) [@vikasmaskeri](https://www.ruby-forum.com/u/vikasmaskeri)\
**Post date:** [May 5, 2009, 8:45am UTC](https://www.ruby-forum.com/t/odd-number-of-arguments-in-nokogiri/167188/1 "2009-05-05T08:45:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![vikasmaskeri](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/6f9a4e/32.png) [@vikasmaskeri](https://www.ruby-forum.com/u/vikasmaskeri)\
**Post date:** [May 5, 2009, 9:55am UTC](https://www.ruby-forum.com/t/odd-number-of-arguments-in-nokogiri/167188/2 "2009-05-05T09:55:27Z")

</div>

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
