
12/08/2002, 07:41
|
| | Fecha de Ingreso: agosto-2002
Mensajes: 8
Antigüedad: 22 años, 9 meses Puntos: 0 | |
Re: Capturar titulo de Pagina bueno el tema del title está solucionado .. ahi teneis como pillar el tema del titulo de una web.. ahora modificaré para convertirlo en una funcion y que se pasen como parametros, la URL, y lo que se quiere buscar...
<%
'Response.Buffer = True
Dim objXMLHTTP, xml
' Create an xmlhttp object:
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
' Or, for version 3.0 of XMLHTTP, use:
'Set xml = Server.CreateObject("MSXML2.ServerXMLHTTP&quo t;)
xml.Open "GET", "http://www.terra.es/", False
xml.Send
Dim texto,inicio,final,longitud,texto2
texto=xml.ResponseText
texto2=Ucase(texto)
inicio=instr(texto2,"<TITLE>")
final=instr(texto2,"</TITLE>")
longitud=(final-inicio)
inicio = inicio + len("<title>")
texto2= Mid(texto,inicio)
response.write left(texto2,longitud- len("<title>"))
Set xml = Nothing
%>
bueno os podeis apiadar de mi que no soy bueno en el tema del ASP llevo poco pero bueno. El único problema es que los acentos, eñes etc... creo que no los trata bien pero algo es algo |