Ir para conteúdo
Fórum Script Brasil

Carlos Prates

Membros
  • Total de itens

    1
  • Registro em

  • Última visita

Tudo que Carlos Prates postou

  1. Precisei e consegui fazer em Delphi. Veja os links : http://www.delphifaq.com/faq/delphi/network/f249.shtml http://www.scalabium.com/faq/dct0139.htm https://www.clubedohardware.com.br/forums/topic/827939-como-ler-o-conteúdo-de-um-site-por-um-memo/ Adaptei o demo do Delphi (C:\Delphi7\Demos\CoolStuf\webbrows.dpr) e alterei os trecho dos codigo abaixo: procedure TMainForm.FindAddress; var EncodedDataString: string; PostData: OleVariant; Headers: OleVariant; i: integer; begin // http://www.delphifaq.com/faq/delphi/network/f249.shtml // First, create a URL encoded string of the data EncodedDataString := 'userName='+HTTPEncode('Luiz Inacio')+'&'+'UserPass='+HTTPEncode('MyPassword'); // The PostData OleVariant needs to be an array of bytes // as large as the string (minus the 0 terminator) PostData := VarArrayCreate([0, length(EncodedDataString)-1], varByte); // Now, move the Ordinal value of the character into the PostData array for i := 1 to length(EncodedDataString) do PostData[i-1] := ord(EncodedDataString); Headers := 'Content-type: application/x-www-form-urlencoded'#10#13; // Parameters 2 and 3 are not used, thus EmptyParam is passed. WebBrowser1.Navigate('https://www.site_a_consultar.com.br', EmptyParam, EmptyParam, PostData, Headers); { // http://www.scalabium.com/faq/dct0139.htm p:='='+HTTPEncode(); h := 'Content-Type: application/x-www-form-urlencoded' + #10#13; UpdateCombo := True; //WebBrowser1.Navigate(WideString(Urls.Text), Flags, Flags, p, Flags); WebBrowser1.Navigate(WideString(''), EmptyParam, EmptyParam, p, h); } end; procedure TMainForm.WebBrowser1DownloadComplete(Sender: TObject); var oStringList: TStringList; html : string; begin { Turn the stop button grey } StopBtn.ImageIndex := 2; { Stop the avi and show the first frame } Animate1.Active := False; //https://www.clubedohardware.com.br/forums/topic/827939-como-ler-o-conteúdo-de-um-site-por-um-memo/ oStringList := TStringList.Create; try oStringList.Text := WebBrowser1.OleObject.document.Body.InnerHTML; html := oStringList.Text; except end; oStringList.Free; showmessage(html); end; Espero ter ajudado. Acho que ainda dá tempo. rsrsrs :)
×
×
  • Criar Novo...