alexs333
alexs333

Reputation: 12593

Nokogiri - selecting non-hidden inputs

I have code that selects input elements:

html = html.at_css("input")

How would I need to modify the selector to exclude hidden inputs from the selection (type="hidden")?

Upvotes: 0

Views: 268

Answers (1)

Chris Salzberg
Chris Salzberg

Reputation: 27384

I believe this is what you want:

html.at_xpath("//input[not (@type='hidden')]")

Just tested this with a simple example and it seems to work.

Upvotes: 1

Related Questions