Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.ruby > #4390 > unrolled thread
| Started by | Robert Garrido <rob_gar_esp@hotmail.com> |
|---|---|
| First post | 2011-05-12 11:50 -0500 |
| Last post | 2011-05-12 19:45 -0500 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.ruby
Mechanize retrieve headers Robert Garrido <rob_gar_esp@hotmail.com> - 2011-05-12 11:50 -0500
Re: Mechanize retrieve headers 7stud -- <bbxx789_05ss@yahoo.com> - 2011-05-12 19:45 -0500
| From | Robert Garrido <rob_gar_esp@hotmail.com> |
|---|---|
| Date | 2011-05-12 11:50 -0500 |
| Subject | Mechanize retrieve headers |
| Message-ID | <ef417a1752934687390349fd6f0f72b2@ruby-forum.com> |
Hi all, I'm using mechanize for web inspection, when I get a URL I get a refresh URL in the headers: <meta http-equiv="refresh" content="2;url=/html/Splash.action?splash="/>\ When I ask to mechanize to list the metadata I do this: pp $page.meta I get: [#<Mechanize::Page::Meta "" "http://localhost/html/Splash.action?splash=">] How can I cleanly retrieve the refresh URL? Thanks! -- Posted via http://www.ruby-forum.com/.
[toc] | [next] | [standalone]
| From | 7stud -- <bbxx789_05ss@yahoo.com> |
|---|---|
| Date | 2011-05-12 19:45 -0500 |
| Message-ID | <2fc605b057c9fed45c2658316aea4cb8@ruby-forum.com> |
| In reply to | #4390 |
Robert Garrido wrote in post #998283: > Hi all, > > I'm using mechanize for web inspection, when I get a URL I get a refresh > URL in the headers: > > <meta http-equiv="refresh" > content="2;url=/html/Splash.action?splash="/>\ > > When I ask to mechanize to list the metadata I do this: > > pp $page.meta > > I get: > > [#<Mechanize::Page::Meta > "" > "http://localhost/html/Splash.action?splash=">] > > How can I cleanly retrieve the refresh URL? > > Thanks! The Mechanize docs follow the ruby tradition: they suck. So I would just use a regex to get that tag from the html of the page. -- Posted via http://www.ruby-forum.com/.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.ruby
csiph-web