Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Bring information from the web into Delphi

Post Reply
Luiz
Posts: 2
Joined: Wed Jun 28, 2023 8:15 pm

Bring information from the web into Delphi

Post by Luiz »

Good afternoon everyone, I'm inciting in Delphi, I use Delphi XE6 and I need to carry out some processes in the browser.
By using the TWVBrowser and TWVWindowParent components of the WebView4Delphi library, I was able to access/display the browser in Delphi and insert existing information in my software on the web page, but I am having difficulties to fetch some information from the web page and return to my software. Does anyone have any suggestions?
User avatar
salvadordf
Posts: 4079
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Bring information from the web into Delphi

Post by salvadordf »

Hi,

Use JavaScript to search the HTML element where the information is located and send it to Delphi with "window.chrome.webview.postMessage".

See the BrowserHostAppCommunication demo for all the details about sending information between the browser and Delphi. Read the code comments in that demo.
Luiz
Posts: 2
Joined: Wed Jun 28, 2023 8:15 pm

Re: Bring information from the web into Delphi

Post by Luiz »

Thank you Salvador! It worked here.
Post Reply