SQLite How to by Tag:
Something like this is ugly but should work: it "should not add any class to other inputs" do @buffer.output.should have_xpath( "//form//input[@id='monster_battle_cry'][not(contains(@class, 'integer'))]" ) end repeat [not(contains(@class, 'integer'))] with other classes....
Simpler is just: doc.search('style,script').remove ...
I generally use CSS over XPath, for readability. This is something like I'd use: require 'open-uri' require 'nokogiri' URL = "http://biz.yahoo.com/z/20130828.html" doc = Nokogiri::HTML(open(URL)) table = doc.css('table')[4] data = table.search('tr')[2..-1].map...
If there are spaces in the class attribute value, that means there are multiple classes applied to the element. To locate an element with multiple classes, the css selector is...