Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Aug : Re: How does a www server know it's not a web client?
| Subject: | Re: How does a www server know it's not a web client? |
| Posted by: | "Francois PIETTE [ICS - MidWare]" (francois.piet..@overbyte.be) |
| Date: | Sun, 6 Aug 2006 11:08:07 |
> I naively used Indy's Get() to download the contents of a web
> site and parse out its data, but the server could tell it was a script
> doing the navigation instead of a web browser.
>
> How does a server tell the difference? Because a navigator uploads
> information such as the PC's OS, screen definition, etc? Is there a
> way for Indy or any other Dephi-friendly Internet component to fake a
> web client?
You have to reproduce the exact same request as a browser is doing. Pay
attention to header lines and cookies. Use a sniffer or other spy tool (such
as SocketSpy http://www.overbyte.Be, follow UserMade link and then search
SocketSpy) to see what request your browser really send and build the same.
Cookies are a two step process: you go to some page, gran the cookie and
then send the cookie back for other pages.
Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html