How to get img src attribute from web page?

Try to use Get children activity. It will give you collection of ui elements. Youe can loop through them and get attribute for each element

@ppr
for example: In our Uipath site, we have the logo image or whatever.i need those image and save it to the local folder.

Not able to indicate the screen in find element activity.

Do you have any idea?
@Palaniyappan @Lahiru.Fernando @lakshman

1 Like

can you tell us,with which browser you have tried? Is with Internet Explorer the same result (Check that IE is not running under protected mode)

@ppr
Yeah, I have tried in IE.but the result is same.
Is it possible to get images by using URL alone?

have a look here by using HTTP Request API. used in an invoke code

Dim webRequest As System.Net.HttpWebRequest = DirectCast(WebRequest.Create(imageUrl), System.Net.HttpWebRequest)
webRequest.AllowWriteStreamBuffering = True
webRequest.Timeout = 30000
Dim webResponse As System.Net.WebResponse = webRequest.GetResponse()
Dim stream As System.IO.Stream  = webResponse.GetResponseStream()
image = Nothing
image = System.Drawing.Image.FromStream(stream)
webResponse.Close()

For image saving:
Invoke the Save method of the tmpImage variable and provide the filepath

You also can check to do it with HTTP Request Activity

2 Likes

Thanks for sharing this and will try now. Can you tell me where can i assign the input parameter like URL of that webpage for this VBA code?

grafik

1 Like

@ppr
First image is property of invoke code and what about second one?is that is invoke method activity?

Yes second one is invoke method. have a look top right corner

Can you explain a bit? where will i use that invoke method activity?

1 Like

Hi @ppr
i got error in invoke code activity. Kindly guide me to sort this out. I have attached the error screenshot for your reference.

@Kalees9486
with the missing details the reason of the exception cannot be derrived. Can you share the xaml or at least some details like the image url.

I have attached the XAML file for your reference.

Flowchart.xaml (7.9 KB)

@Kalees9486
Have a look here. Just adjust Url and ExportDir as by your environment and let it run
ImageLoader.xaml (6.6 KB)

1 Like

Hi @ppr

Thanks for your guidance. Here we gave the URL of the image. But what we need is, we have to give the website URL. Based on the website URL,we need to store the logo images to the local folder then extract the image details like color, resolution, etc.,

Then you will Catch with Find children all Images, readout the SRC Attribute (as mentioned above) and Download the Image as done with the snippet from above

Not getting those attributes from this selectors also suggest how to use this find children output variable. I have attached the screenshot for your reference,