Kalees9486
(Ashwin Kaleeswaran)
April 9, 2020, 6:43am
1
Hi,
I have a use case which extracting image details from their web page and its based on the web link which i have to given in the input of our flow. I need to extract img src attributes and store it as image in my local machine.I am not able to get this attributes.
Kindly suggest some possibility that would be very helpful for this automation.
ThankYou
ppr
(Peter Preuss)
April 9, 2020, 6:47am
2
@Kalees9486
IT IS possible. Can be done by
Get Attribute Activity
For datascrapping. Configured the columns manually and Change the atrr config to src
Find children with a Filter to IMG and later Processing the found children retrieving the SRC attribute
Kalees9486
(Ashwin Kaleeswaran)
April 9, 2020, 7:03am
3
@ppr ,
Get attribute is for single position right? But we need that img src from whole page.Means, that image not in fixed position.it is available in any place of that page.This process is for multipage.So have to change the pahe selectors dynamically.
Thank U
ppr
(Peter Preuss)
April 9, 2020, 7:17am
4
This will be handled with the selector to Image and is Not bound to Position. Can you Share some more Details. Eg. Screenshots. Thanks
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
Kalees9486
(Ashwin Kaleeswaran)
April 9, 2020, 7:32am
6
@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.
Kalees9486
(Ashwin Kaleeswaran)
April 9, 2020, 7:37am
7
Not able to indicate the screen in find element activity.
Kalees9486
(Ashwin Kaleeswaran)
April 9, 2020, 7:55am
8
1 Like
ppr
(Peter Preuss)
April 9, 2020, 9:41am
9
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)
Kalees9486
(Ashwin Kaleeswaran)
April 9, 2020, 9:53am
10
@ppr
Yeah, I have tried in IE.but the result is same.
Is it possible to get images by using URL alone?
ppr
(Peter Preuss)
April 9, 2020, 9:59am
11
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
Kalees9486
(Ashwin Kaleeswaran)
April 9, 2020, 10:04am
12
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?
Kalees9486
(Ashwin Kaleeswaran)
April 9, 2020, 11:38am
14
@ppr
First image is property of invoke code and what about second one?is that is invoke method activity?
ppr
(Peter Preuss)
April 9, 2020, 11:40am
15
Yes second one is invoke method. have a look top right corner
Kalees9486
(Ashwin Kaleeswaran)
April 9, 2020, 11:53am
16
Can you explain a bit? where will i use that invoke method activity?
Kalees9486
(Ashwin Kaleeswaran)
April 11, 2020, 3:00am
19
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.
ppr
(Peter Preuss)
April 11, 2020, 2:52pm
20
@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.
Kalees9486
(Ashwin Kaleeswaran)
April 11, 2020, 3:07pm
21
I have attached the XAML file for your reference.
Flowchart.xaml (7.9 KB)