From: Roland Jesse Date: 2001-09-11T21:19:21+09:00 Subject: [ruby-talk:21080] html-parser fails at images with given height Hi, using the HTMLParser from shows an error when parsing the following simple html text: -----------------------------------------------------

Here comes an image:

Above is an image.

----------------------------------------------------- Parsing that with the following code: ----------------------------------------------------- #!/usr/bin/env ruby require 'html-parser' require 'formatter' file = File.open( "dummy.html") data = file.read file.close w = DumbWriter.new f = AbstractFormatter.new( w) p = HTMLParser.new( f) p.feed( data) p.close ----------------------------------------------------- results in: /usr/local/lib/ruby/site_ruby/1.6/html-parser.rb:412:in `Integer': invalid value for Integer: ""42"" (ArgumentError) from /usr/local/lib/ruby/site_ruby/1.6/html-parser.rb:412:in `do_img' from /usr/local/lib/ruby/site_ruby/1.6/html-parser.rb:395:in `each' from /usr/local/lib/ruby/site_ruby/1.6/html-parser.rb:395:in `do_img' from /usr/local/lib/ruby/site_ruby/1.6/sgml-parser.rb:281:in `send' from /usr/local/lib/ruby/site_ruby/1.6/sgml-parser.rb:281:in `handle_starttag' from /usr/local/lib/ruby/site_ruby/1.6/sgml-parser.rb:233:in `finish_starttag' from /usr/local/lib/ruby/site_ruby/1.6/sgml-parser.rb:208:in `parse_starttag' from /usr/local/lib/ruby/site_ruby/1.6/sgml-parser.rb:89:in `goahead' from /usr/local/lib/ruby/site_ruby/1.6/sgml-parser.rb:58:in `feed' from ./dummy.rb:14 My question now is: Does anybody know of a HTML parser out there that can handle (simply ignore them would be enough) tags? Roland