Autor Beitrag
Gambit
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 36



BeitragVerfasst: Sa 05.07.03 14:45 
Hallo!

Ich möchte mit fogender Routine den Inhalt einer Web Seite zunächst erstmal in ein Memo laden:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.Button1Click(Sender: TObject);
begin
  memo1.Text := idHTTP1.Get('http://www.google.com/custom?       q=blahblah&domains=www.blahblah&sitesearch=www.blahblah.de');
end;


Dann bekomm ich eine Exception mit der Meldung Error 403 forbidden.

Wenn ich den Link direkt in Google eingebe funzt er.

Kann man da irgendwas machen?

Gruß

Gambit
Moritz M.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1672



BeitragVerfasst: So 06.07.03 15:52 
Du musst soweit ich weiß HandleRedirects einschalten, dann sollte es gehen.
Wenn nicht versuch es mal mti dem ersetzen von den Sonderzeichen durch die umgewandelten Sonderzeichen.
Gambit Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 36



BeitragVerfasst: So 06.07.03 16:05 
Ich glaube es liegt daran, dass die Seite ja eigentlich noch gar nicht existiert bei der Anfrage. Also kann ich mir auch deren Inhalt schlecht anzeigen lassen. Ich habs jetzt erstmal so gelöst, dass ich ein WebBrowser Objekt genommen habe und die Seite erstmal aufbauen lasse. Dann hole ich mir den Inhalt mit:

ausblenden Delphi-Quelltext
1:
htmlcode :=WebBrowser1.OleObject.Document.Body.InnerHtml;					


Das funzt soweit ganz gut, bis auf die Sache, dass ich den WebBrowser gar nicht sehen will(Siehe den anderen Thread).

Gambit
Moritz M.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1672



BeitragVerfasst: So 06.07.03 16:25 
Versuchs es trotzdem bitte mal mit HandleRedirects=True
Gambit Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 36



BeitragVerfasst: So 06.07.03 16:29 
Hab ich schon gemacht, nützt nix. Was sollte das denn eigentlich normalerweise bewirken?

Gruß

Gambit
Moritz M.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1672



BeitragVerfasst: So 06.07.03 16:33 
Das Redirects, aslo Weiterleitungen, verfolgt werden.
Fronty
Hält's aus hier
Beiträge: 3



BeitragVerfasst: Mo 14.07.03 17:51 
Hallo,
evtl hilft es was einen anderen Useragenten zu verwenden ?

idhttp1.Request.UserAgent

Manchmal wird der standard Agent nicht zugelassen,weiss aber nich obs in diesem beispiel auch daran liegt.

mfg,Fronty