Actually this is the question, I tried the synapse, but something does not work, who can share the working script?
PS: I ask in Google / Yandex or TP not to send me
Actually this is the question, I tried the synapse, but something does not work, who can share the working script?
PS: I ask in Google / Yandex or TP not to send me
For authorization on almost any site, you can use the method of sorting HTML code. At first it is better to look at the source code of the page, if it is large, then this method may work too long, but there is a solution: we purposely write the wrong password, then the browser will transfer us to another page, there the HTML code will be less, therefore we will authorize it programmatically on it. Create a project and throw two buttons on the form and a WebBrowser component from the Internet tab; The first button is needed to open the page, and the second is for authorization.
Code
// for the button to open the site
procedure TAutorizationForm.BitBtnOpenPageClick (Sender: TObject);
begin
WebBrowser.Navigate ('here we write the desired site');
end;
// for authorization button
procedure TAutorizationForm.BitBtnAutorizationClick (Sender: TObject);
Var
i: Integer;
s: string;
html_tag: Variant;
begin
html_tag: = WebBrowser.OleObject.Document.Forms.Item (0) .Elements;
For i: = 0 To (html_tag.Length-1) Do
Begin
If (html_tag.item (i) .name = 'here you need to write the name of the field in which you want to enter the user name') Then html_tag.item (i) .value: = 'here we write the user name';
If (html_tag.item (i) .name = 'here you need to write the name of the field in which you want to enter the password') Then
html_tag.item (i) .value: = 'write the password here';
If (html_tag.item (i) .value = 'here we write the name of the button to enter') Then html_tag.item (i) .click;
End;
end;
I think it is an advantage to use Twebbrouser to work with the Internet. There are many components for sending PostGet requests from Delphi from WinSocks and not loved by the author of the Indy theme to ICS Synapse and there are even ready-made components for authorization on various sites including the VKontakte site.
If you still move away from the belief that Indy does not fit, I will put you a piece of code for authorization on the vkontakte site.
Source: https://ru.stackoverflow.com/questions/40291/
All Articles