I'm logged into a webpage/servlet using Mechanize.
I have a page object
jobShortListPg = agent.get(addressOfPage)
When i use the following
puts jobShortListPg
I get the "mechanized" version of the page which I don't want e.g.
#<Mechanize::Page::Link "Home" "blahICScriptProgramName=WEBLIB_MENU.ISCRIPT3.FieldFormula.IScript_DrillDown&target=main0&Level=0&RL=&navc=3171">
How do I get the html source of the page instead?
Use .body
puts jobShortListPg.body
Use the content method of the page object.
jobShortListPg.content
来源:https://stackoverflow.com/questions/6487101/how-to-get-the-page-source-with-mechanize-nokogiri