Delphi Coding - Delphide Webbrowser Usage

Nowadays, many processes are performed on web pages and you can check web pages with delphi coding. However, in cases such as assigning passwords to users, it is necessary to do the same on the website many times. With Delphi, we can automate the process with webbrowser.

The web browser component in Delphi 7 is actually an ActiveX component of the version of Internet Explorer on the operating system. This component is on the Internet tab in Delphi 7.

The Webbrowser component works like Internet Explorer. So if you have an older version of Internet Explorer, it's possible that you'll get error messages from scripts on current sites. In this case, we use the following code to prevent the Delphi side from interrupting the transaction:

WebBrowser1.Silent:=true;

The structure we use to open the web address entered in the component is as follows:

Here we use the Navigate method to specify the address of the web page to be visited. To wait for the entire web page to load, the while loop is being used.

While automating operations, we will probably need to log in to the web page. Therefore, we need to be able to automatically fill in the input sections on the web page. To do this, we use the following structure:

After that, our job is to take the information we want from the page to the Delphi program. We are having trouble getting the values returned here with Ajax. To get rid of this problem, the subprogram is: