Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

kyllopardiun

[Resolvido] pegar dados de html externo

Recommended Posts

Quero ler algumas linhas de uma página de um arquivo html,

e publica-la mostra-la sem ter que salvar os arquivos no meu site

 

<%
<%
Dim StrArquivo , objFSO , objArquivo
Dim a(3)
a(0)="http://selos.climatempo.com.br/selos/MostraSelo120.php?CODCIDADE="
a(1)=(request.querystring("kyllo"))
a(2)="&SKIN="
a(3)=(request.querystring("cor"))

url = (join(a,""))

Set xml = Server.CreateObject("MSXML2.ServerXMLHTTP")
xml.Open "GET", url, False
xml.setRequestHeader "User-Agent","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"
xml.setRequestHeader "Content-Type","text/html; charset=iso-8859-1"
xml.Send
o = xml.responsebody
set xml = nothing

Set objFSO = Server.CreateObject("ADODB.Stream")
strArquivo = o
set objArquivo = ObjFSO.OpenAsTextStream(forReading,false)
	While Not objArquivo.AtEndOfStream
Linha1 = Linha1 & ObjStream.Readline 
Linha7 = Linha7 & ObjStream.Readline 
 Wend
		 Application("Linha1") = Linha1
		 Application("Linha2") = Linha2
 
objArquivo.close
set objArquivo = Nothing
set ObjFSO = Nothing 
response.write linha 1
response.write linha 7
%>

porém se não for possivel gostaria de poder ler e mostrar o html original do site,

pois posso fazer com ele alguma pog com javascript ...

 

porque tentei com isto e não consegui:

 

<%
Dim StrArquivo , objFSO , objArquivo
Dim a(3)
a(0)="http://selos.climatempo.com.br/selos/MostraSelo120.php?CODCIDADE="
a(1)=(request.querystring("kyllo"))
a(2)="&SKIN="
a(3)=(request.querystring("cor"))

url = (join(a,""))

Set xml = Server.CreateObject("MSXML2.ServerXMLHTTP")
xml.Open "GET", url, False
xml.setRequestHeader "User-Agent","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"
xml.setRequestHeader "Content-Type","text/html; charset=iso-8859-1"
xml.Send
o = xml.responsebody
set xml = nothing

Set objFSO = Server.CreateObject("ADODB.Stream")
strArquivo = o
set objArquivo = ObjFSO.OpenTextFile(strArquivo)
Response.Write objArquivo.ReadALL

objArquivo.close
set objArquivo = Nothing
set ObjFSO = Nothing 
%>

 

agradeço vossa colaboração (=

Compartilhar este post


Link para o post
Compartilhar em outros sites

dá uma olhada neste link aqui

Compartilhar este post


Link para o post
Compartilhar em outros sites

e este link aqui

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.