hey i'm cameron mackenzie at cameronmcnz on twitter and i wanted to show you how to
data scrape some webpages so like always i'll start this off by creating a new process and
i'll call it best buy screen scraper because i've got some stuff i want to buy over at best buy i've
been looking for a watch i'm really looking for a discount on a garmin watch really love garmin's
and i'm looking for one that's on sale and specifically it has to be a garmin watch and you
can see this is a list of all the garmin watches on sale over at best buy i like to sort them by
price as well from high to low like to dream of having a phoenix 6s anyways i'd like to automate
kind of scraping this page and gathering all this data so that i don't have to go to the
page every single day that the page will come to me maybe through an email and so the way
you do that is through screen scraping watch this i'm going to copy the url that's up here
and then i'm going to come to uipath open the main workflow window and say you know what i want to
do some data scraping so i click data scraping the tool comes up and it says okay what do you want to
scrape and i want to grab all of the information here about all these garmin watches that are for
sale like to you know maybe run this once a day and then see if there's any new items for sale
and so you highlight well i want to highlight the whole range here that encompasses an entire watch
the price the the link the image and then it says okay well if there's the start one what does the
finish item look like in this list and there's the finished one right there i'll click next
i'll try and highlight the same amount of data for the finished one and it'll say fantastic we've got
these two columns here and i guess i'll call the first column garmin item and the second column
the url and then the other thing i can do is i can extract maybe some extra data and you can
see there the list of the garment items are being pulled out there all the information that's really
important and over on the right hand side it's the url to get to the item but really what i'm
interested in is the price right i want to know if there's been any price drop or any price change so
you can also click this extract co-related data and so you can kind of go dig deeper inside of the
inside of the web page inside of the item and the item that i really want is i want that that price
right i want to keep track of what the price of these items are i want you to pick it in
the first one and then pick the corresponding one in the second one corresponding location
there's the price right there and then it's figured all of that stuff out and then i'll say
that's the sale price i'll click the next button and then you can see that
the the whole data from this page has now been extracted into this data table
so i think i'm finished here i've got the the product i've got all of the information on it
identify the element that navigates the next pages well there's no next page here because sometimes
you might have a pagination right like click this button for more go to page two there's none of
that there that's all the items on the page so i don't need to indicate any pagination there
and then from here this is gonna extract all of that data it's all get puts into a data table
called extract data table and if i want to gain access to that information well i could just write
that to an excel file i could send the data in an email i think for right now it just be nice
to loop through that data and take a look at it and so the for each row activity will allow you
to do this don't pick the for each activity very different it won't cast the object into a row and
it'll cause problems here i want to use the for each row activity and say you know for each row
well let's just extract some data for it so i'll do some right line here
and in this case i can get row at zero dot two string and then maybe just well i've
got three rows here so i'll take all three and of course instead of row zero i'll do row one
and i'll do row two and i'm going to run this application make sure that well first of all
i'll make sure that there's no errors yeah that looks like i'll like it's all good and i will
run this application and you will see it's going to go onto that page do a little bit of scraping
and then finally here in this console you'll see all of the information that i wanted the
name of the product and all the details plus the sale price for the item plus the url
all of that comes nice and handsomely onto the page and there you go that's
how easy it is to screen scrape web pages and extract important metadata out of those pages
and there you go that's how easy it is to data scrape web pages and uipath if you enjoyed
this tutorial head over to theserverside.com i'm the editor-in-chief over there if you're
interested in my personal antics follow me on twitter at cameronmcnz and subscribe on youtube