Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logging in to a website and downloading info 1

Status
Not open for further replies.

Stretchwickster

Programmer
Apr 30, 2001
1,746
GB
Hi,

I would like to write a Delphi app that automates a
log-in to a website (i.e. enters my username and password)
and then retrieves information from my account. Is this
possible? If so, how would I go about it?

Your help would be much appreciated! Clive [infinity]
Ex nihilo, nihil fit (Out of nothing, nothing comes)
 
Well, depends exactly what you want to do. What do you want to retrieve? Where from?
 
I can do the retrieval of data once I've logged in, but just need to know how to automate the log-in part. Btw, I'm using Delphi 6. Clive [infinity]
Ex nihilo, nihil fit (Out of nothing, nothing comes)
 
not yet...

have not got the time to investigate the problem...

cheers

:)

mha
 
Hi,
I usually start everithigs with the convinction that if it can be done, you can do it with Delphi.

Try to look at IndyClients palette and put a TIdHTTP component on your form naming it HTTP1.

Now we take the HTML of the page you want via HTTP1.Get(URLEdit.Text):

HTTP1.Request.Username := '';
HTTP1.Request.Password := '';
HTTP1.Request.ContentType := '';
HTTP1.Intercept := LogDebug;
memoHTML.Lines.Clear; //Accept the HTML of the page
memoHTML.Lines.Text := HTTP1.Get(URLEdit.Text);

In memoHTML we have the page, where you can find your informations.

To login look at HTTP1.PUT

Hope this can be usefully.

Ciao,
Geppo Darkson.

 
Thank you very much Geppo - I didn't really know where to start looking! I'll have a play with IndyClients.

Clive [infinity]
Ex nihilo, nihil fit (Out of nothing, nothing comes)
 
In the end I used
Code:
HTTP1.Post('[URL unfurl="true"]http://www.bbc.co.uk/cgi-perl/celebdaq/trade.cgi',[/URL] ParamData, PostDataStream);
Where ParamData aad PostDataStream are of type TStringStream. Basically ParamData passes in some extra data with the URL call and PostDataStream stores the output of the call i.e. the website code.

Clive [infinity]
Ex nihilo, nihil fit (Out of nothing, nothing comes)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top