Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return value of a meta tag from html document.

Status
Not open for further replies.

fooobee

Technical User
Nov 13, 2003
33
US
Can anyone show me an example script that can extract the value of a meta tag from an html document? I can't find any reference on how to do this.

~Patrick
 
Are you opening the document using the IE object?

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Whatever the best way you think would be to open the document.
 
I need it to do post-scripting on a search index. We have to change file names in the index to a meta tag desc.
 
Well, this code will get all of the HTML on a page and you could parse the meta tags from it but I'm not sure that this is the solution that you are looking for.
Code:
Option Explicit

Dim oIE, oDoc

Set oIE = createobject("internetexplorer.application")
oIE.Navigate("[URL unfurl="true"]www.google.com")[/URL]
Do While oIE.Busy
	WScript.Sleep 200
Loop
oIE.Visible = False
Set oDoc = oIE.Document
WScript.Echo oDoc.documentElement.InnerHTML

oIE.Quit

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top