Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi HTTP und Cookies (https://www.delphipraxis.net/118311-http-und-cookies.html)

Isaev 5. Aug 2008 03:07


HTTP und Cookies
 
Grüß euch!

Aufgabestellung:
Man muss 2 Linkclicken zu emulieren...

1. http://softonet.com/index.php?pin=4123
2. http://softonet.com/index.php?do=cat&category=soft
http://smages.com/i/d3/3b/d33b3c8d6b...db351160ee.png


Für 2. Link 1. sollte als "Refer" sein...

Ich habe so gemacht:
Delphi-Quellcode:
// am Form liegt IdHTTP1, IdCookieManager1
// IdHTTP1.CookieManager:=IdCookieManager1;
// IdHTTP1.AllowCookies:=True;
// IdHTTP1.HandleRedirects:=True;

  S1:='http://softonet.com/index.php?pin=4123';
//  Memo1.Lines.Append(S1);
  S2:=IdHTTP1.Get(S1);
//  Memo1.Lines.Append(IdHTTP1.Response.Server+': '+IdHTTP1.Response.ResponseText);
  S2:='http://softonet.com/index.php?do=cat&category=soft';
//  Memo1.Lines.Append(S2);

  IdHTTP1.Request.Referer:=S1;
  S1:=IdHTTP1.Get(S2);
//  For A:=0 To IdHTTP1.CookieManager.CookieCollection.Count-1 Do
//    Memo1.Lines.Append(IdHTTP1.CookieManager.CookieCollection.Items[A].CookieText);
Funktioniert aber nicht :wall:
Wo ist mein Fehler?

generic 6. Aug 2008 15:00

Re: HTTP und Cookies
 
Geht das vielleicht nicht, weil dort kurz noch etwas mit Javascript aufpoppt (wenn ich mit den Browser klicke)?

Isaev 6. Aug 2008 16:25

Re: HTTP und Cookies
 
Zitat:

Zitat von generic
weil dort kurz noch etwas mit Javascript aufpoppt

Ja wohl!
Ich habe schon gefunden... Jetzt funktioniert!
Danke!


Alle Zeitangaben in WEZ +1. Es ist jetzt 01:52 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz