Clément 148 Posted May 30, 2023 (edited) In this project I'm downloading a page in EdgeBrowser. My application is extracting the main table, and displays it nicelly in a TreeView structure. The HTML table has several rows, and the last cell has a "ng-click" which I need to click. My TreeView already has a button, when the user clicks that button, I must click the corresponding "ng-click" and download detailed information about the product and display it. The last cell information looks like this (This is the last cell HTML code.) I have no idea how to reach that "ng-click" fellow: <a href="" class="btn btn-transparent" ng-if="::thisProductInventory.availableBallast && thisProductInventory.isAvailable" ng-class="{'btn-block':$root.mediaQueries['$res-phone-mid-landscape']()}" ng-click="ProductInventory(thisProductInventory, $event)"> There's no Click, onClick or any other option which I'm familiar with. It appears to be some Angular stuff. Can shed some light? I'm using DOM to navigate / extract data from the page. So ideally id would be perfect to reach something like "element.click()". (I have no way to modify the javascript code. All I can do is "interact" through Delphi /Edge with the page.) TIA Edited May 30, 2023 by Clément Share this post Link to post
Clément 148 Posted May 30, 2023 Just managed to do it in plain JavaScript! I navigate to the corresponding row using DOM, found the <a> tag and called click..... So easy! 1 Share this post Link to post
Pat Foley 51 Posted May 30, 2023 Just don't set root to Internet! 🙂 That JS is scary stuff. Share this post Link to post
Clément 148 Posted May 31, 2023 JS is scary! Goes against everything that is safe and sound. I really can't say who ( or what) wrote that code. It be can be a person, a framework or ChatGPT. They prefer to use a "Desktop application" to handle filtering and selection rather than modify the code. This should raise some red flags. Share this post Link to post