Ruby on Rails Saturday, June 1, 2013

doc = Nokogiri::HTML::Document.parse(<<-eohtml)
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
</head>
<body>
<form>
<input name="email" disabled="disabled" />
<input name="id" />
</form>
</body>
</html>
eohtml

p doc.css("input:disabled").count
# >> 2
# ~>
/home/kirti/.rvm/gems/ruby-2.0.0-p0/gems/nokogiri-1.5.9/lib/nokogiri/xml/node.rb:159:in
`evaluate': xmlXPathCompOpEval: function disabled not found
(RuntimeError)
# ~> from
/home/kirti/.rvm/gems/ruby-2.0.0-p0/gems/nokogiri-1.5.9/lib/nokogiri/xml/node.rb:159:in
`block in xpath'
# ~> from
/home/kirti/.rvm/gems/ruby-2.0.0-p0/gems/nokogiri-1.5.9/lib/nokogiri/xml/node.rb:150:in
`map'
# ~> from
/home/kirti/.rvm/gems/ruby-2.0.0-p0/gems/nokogiri-1.5.9/lib/nokogiri/xml/node.rb:150:in
`xpath'
# ~> from
/home/kirti/.rvm/gems/ruby-2.0.0-p0/gems/nokogiri-1.5.9/lib/nokogiri/xml/node.rb:214:in
`css'
# ~> from -:69:in `<main>'

************************
Why the errors are throwing up?

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/25709aaec942e4b1076317d23379aeac%40ruby-forum.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment