This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Initialize Mechanize Agent | |
| agent = Mechanize.new | |
| # Visit a web page | |
| agent.get 'http://localhost:3000/' | |
| # get the url of the current page | |
| agent.page.uri #=> http://localhost:3000 | |
| # agent remembers the scheme + host, so no need to supply it when navigating somewhere else |