Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #4390 > unrolled thread

Mechanize retrieve headers

Started byRobert Garrido <rob_gar_esp@hotmail.com>
First post2011-05-12 11:50 -0500
Last post2011-05-12 19:45 -0500
Articles 2 — 2 participants

Back to article view | Back to comp.lang.ruby


Contents

  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

#4390 — Mechanize retrieve headers

FromRobert Garrido <rob_gar_esp@hotmail.com>
Date2011-05-12 11:50 -0500
SubjectMechanize 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]


#4449

From7stud -- <bbxx789_05ss@yahoo.com>
Date2011-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