Page 1 of 1

Bring information from the web into Delphi

Posted: Thu Jun 29, 2023 3:44 pm
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?

Re: Bring information from the web into Delphi

Posted: Fri Jun 30, 2023 8:09 am
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.

Re: Bring information from the web into Delphi

Posted: Mon Jul 03, 2023 5:58 pm
by Luiz
Thank you Salvador! It worked here.