Maheshkumar.J Maheshkumar.J - 1 year ago 46
Ruby Question

How do i resolve this error?undefined method `at_css' for #<Mechanize::Page:0xb4b76434>

NoMethodError Exception: undefined method `at_css' for #
At the time of run this code,

Answer Source

You need to call the root method on the Mechanize::Page object first:

page ="http://....")

root will return a Nokogiri::HTML::Document, which implements the at_css method.