codice:
<%
Dim objXMLHttp
DIM app, app2, re, titolo, parolechiave
Set objXMLHttp = Server.CreateObject("Msxml2.XMLHTTP.4.0")
objXMLHttp.Open "GET", "http://www.helpinlinea.it", False
objXMLHttp.Send
app=objXMLHttp.responseText
Set re = new RegExp
re.IgnoreCase = true
re.Global = false
re.Pattern = "<title>(.*?)<\/title>"
Set Matches = re.Execute(app)
If Matches.Count > 0 then
Response.Write "titolo: " & Mid(Matches(0).Value, 8, Len(Matches(0).Value) - 15) & "
"
Else
Response.Write "titolo non presente.
"
End If
re.Pattern = "\x22keywords\x22(.*?)>"
Set Matches = re.Execute(app)
If Matches.Count > 0 then
app2=Mid(Matches(0).Value, 12, Len(Matches(0).Value) - 1)
re.Pattern="\x22(.*?)\x22"
set Matches=re.execute(app2)
Response.Write "parole chiave: " & Mid(Matches(0).Value,2,Len(Matches(0).Value)-2) & "
"
Else
Response.Write "keywords non presenti.
"
End If
re.Pattern = "\x22description\x22(.*?)>"
Set Matches = re.Execute(app)
If Matches.Count > 0 then
app2=Mid(Matches(0).Value, 14, Len(Matches(0).Value) - 1)
re.Pattern="\x22(.*?)\x22"
set Matches=re.execute(app2)
Response.Write "description: " & Mid(Matches(0).Value,2,Len(Matches(0).Value)-2) & "
"
Else
Response.Write "description non presente.
"
End If
%>
PS:
da notare che ci possono essere problemi vari.. maiuscole/minuscole, tanto per cominciare.