Nokogiri#css("input:disabled") not working

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>'

What makes you think that's valid syntax?

Hassan Schroeder wrote in post #1110918:

Uh, that's nice. But your question is about Nokogiri, not jQuery.

Hassan Schroeder wrote in post #1110922:

Where in the Nokogiri docs does it say that? Where in the docs is
an example of the syntax you are trying to use?

Hassan Schroeder wrote in post #1110928:

Where in the Nokogiri docs does it say that? Where in the docs is
an example of the syntax you are trying to use?

see below:

require "nokogiri"
doc = Nokogiri::HTML::Document.parse(<<-eohtml)
<html>
<head>
<style>
div { float:left; }
span { color:blue; }
</style>
</head>
<body>
<div>
      <p>div1 p1</p>
      <p>div1 p2</p>
      <p>div1 p3</p>
      <p>div1 p4</p>
</div>
<div>
      <p>div2 p1</p>
      <p>div2 p2</p>
      <p>div2 p3</p>
      <p>div2 p4</p>
</div>
</body>
</html>
eohtml

p doc.css("div p:eq(2)").map { |e| e.text }
# >> ["div1 p2", "div2 p2"]

Where in the Nokogiri docs does it say that? Where in the docs is
an example of the syntax you are trying to use?

see below:

Uh, as I said -- in the docs?

p doc.css("div p:eq(2)")

And in this case, what do you think 'eq' is ?

Hassan Schroeder wrote in post #1110932:

Uh, sure. Whatever you want to believe. Good luck!

Hassan Schroeder wrote in post #1110937:

So here is something I don't quite understand. According to [1],
"input:disabled" is a quite valid CSS selector.

Given this[2]:

<html><body>
<style>input:disabled {background: #0F0; color: #F00;}</style>
<input type="text" id="greenjunk" name="greenjunk" value="nada" disabled />
<input type="text" id="name" name="name" value="Joe" />
<input type="submit" id="submit" name="submit" value="submit" />
</body></html>

Why wouldn't doc.css("input:disabled") also work? Clearly it doesn't,
but I don't know what it *should* be. (Noting that xpath would be quite
different, of course.)

[1] https://developer.mozilla.org/en-US/docs/Web/CSS/:disabled
[2] see this ugly thing at https://dl.dropboxusercontent.com/u/571329/Examples/greenjunk.html

Tamara Temple wrote in post #1110947:

[1] https://developer.mozilla.org/en-US/docs/Web/CSS/:disabled
[2] see this ugly thing at
https://dl.dropboxusercontent.com/u/571329/Examples/greenjunk.html

See the issue - https://github.com/sparklemotion/nokogiri/issues/907