Is there any option to get count/html of all images in a specific table/webpage using power automate desktop?
Just simple two lines does it all:
WebAutomation.DataExtraction.ExtractList BrowserInstance: Browser Control: $'''img''' ExtractionParameters: {['', 'Source Link', ''] } ExtractedData=> DataFromWebPage
SET ImgNum TO DataFromWebPage.RowsCount
@keyurpsspl1, you can do it with the 'Run JavaScript function on webpage action.
I don't have any affiliation with this website, I just picked it at random because it had multiple images.
You'll need to do more processing if you want to get the URLs of the images into Excel or some other program, but maybe this will get you started.
This is the code for the first function:
function ExecuteScript() {
var imagez = document.getElementsByTagName("img");
return imagez.length;
}
'imagez.length' is the count of images, but as a number. If you want to display it you need to convert it to text first (see flow).
The second function grabs the URL of the first image on the page. Then it's displayed in a message box.
function ExecuteScript() {
var imagez = document.getElementsByTagName("img");
return imagez[0].src;
}
You can also experiment with 'Get details of element on web page'. This is often (some might say always) a better approach. You can modify the selector to use variables, of course.
Saving the best for last, you can 'Extract data from webpage'.
Here I just grabbed all the images on the page and stored the URLs in an Excel sheet. If you need the count, you can count the rows with an Excel action.
A couple of video links for this action:
Tomac
986
Moderator
stampcoin
699
Super User 2025 Season 2
Riyaz_riz11
577
Super User 2025 Season 2