I have the following HTML:
<select name="ctl00$cp$cbDzien" id="ctl00_cp_cbDzien" onchange="cbDzienGodzina_onChange(this);" style="width:200px;">
<option value="-1"></option>
<option value="2013-10-07">2013-10-07</option>
<option value="2013-10-08">2013-10-08</option>
<option value="2013-10-09">2013-10-09</option>
<option value="2013-10-10">2013-10-10</option>
<option value="2013-10-11">2013-10-11</option>
<option value="2013-10-14">2013-10-14</option>
<option value="2013-10-15">2013-10-15</option>
<option value="2013-10-16">2013-10-16</option>
<option value="2013-10-17">2013-10-17</option>
<option value="2013-10-18">2013-10-18</option>
<option value="2013-10-23">2013-10-23</option>
<option value="2013-10-24">2013-10-24</option>
<option value="2013-10-25">2013-10-25</option>
<option value="2013-10-28">2013-10-28</option>
<option value="2013-10-29">2013-10-29</option>
<option value="2013-10-31">2013-10-31</option>
</select>
My code:
@get_doc = Nokogiri::HTML(page)
@get_doc .at_css("select#ctl00_cp_cbDzien").each do |d|
puts d[value]
end
However, I didn't see options with such code, and I also need to select last-1 value (2013-10-29) in my example. How can I do this?