[Wtr-general] get the meta tag out of a page
Charley Baker
charley.baker at gmail.com
Sat Aug 19 13:14:27 EDT 2006
Watir deals with the html of the page, not the http headers. I'm not sure
what the hard way is that you're dealing with currently, but you can access
most of this information through ruby's net libraries:
http://www.rubycentral.com/book/lib_network.html
Take a look at the section: class Net::HTTP
There are some pretty simple examples which should get you what you want,
then it's a matter of pulling out whatever headers you're interested in from
the returned hash and asserting on them.
-Charley
On 8/16/06, Alien Ruby <forum-watir-users at openqa.org> wrote:
>
> Let me make clearer...
>
> for example,
>
> ie.title of this page will out put "OpenQA Forums: Watir General"
>
> but, I want something that can spits out the meta tag. like
>
> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
>
> or just the name and content? and what if they have multiple meta tags?
>
> I've been doing this a hard way. I assume this can be done in a very easy
> way, will it? maybe something like ie.meta...... it.html.meta....
>
> please any suggestion will be accepted.
>
> thank you soo much.
> ---------------------------------------------------------------------
> Posted via Jive Forums
> http://forums.openqa.org/thread.jspa?threadID=3625&messageID=10048#10048
> _______________________________________________
> Wtr-general mailing list
> Wtr-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-general
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060819/971f9006/attachment.html
More information about the Wtr-general
mailing list