No clue on this one.. Its acting weird, and the response I want is getting put to the terminal instead of the file.. But I never asked the results to be put to the terminal. Odd.. How can I get the results from Mechanize / Nokogiri printed to a file?
a = Mechanize.new { |agent|
agent.user_agent_alias = 'Mac Safari'
}
a.set_proxy '64.213.148.50', 8080
a.get('http://www.amazon.com')
a.page.forms[0]["field-keywords"] = "B009NWFP5Q"
a.page.forms[0].submit
try = a.page.link_with(:text => "Madden Girl Women's Harmonee Ballet Flat").click
url = a.get(try).body
doc = Nokogiri::HTML(open(url))
result = doc.inspect
after = "after.txt"
File.write(after, result)