Mechanize retrieve headers

R

Robert Garrido

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!
 
7

7stud --

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top