I want to find a link on a local page and then click on it. Right now I am successful in finding a particular link (because there are many links with the same class), but I am unable to click on it. Here is my code:
# encoding: utf-8
require 'rubygems'
require 'watir-webdriver'
require 'json'
require 'sqlite3'
require 'haml'
require 'data_mapper'
require 'open-uri'
require 'nokogiri'
require 'pp'
require 'mysql'
require 'dbi'
require 'mechanize'
page_html = Nokogiri::HTML(open("My Library book.com.htm"))
page_html.css("div.adbl-lib-content
table")[0].css('tbody').css('tr')[8].css('td')[9].css('div').css('a')
and I am getting this result:
<a style="color: #FFF; font-family: Arial; font-size: 11px; font-weight: bold; background-color: #333333; padding: 2px 8px;" title="Click to download" class="adbl-download-it" href="#">DOWNLOAD</a>
How can I click this link?