Okay, everyone.
Now let's extend our script so that we can start scraping the description pages of all the homes we
get inside of this function.
So to do that, let's go ahead and make a new function.
Let's call it main.
And inside Main, we cut this function, call in here and we say we want to return a homes array from
this one.
So const homes await and then we want to change this one.
The function down here to say return homes instead and then I'm going to remove the console log.
And now let's put the console log down here instead to see if we get the array that we want.
And then we are going to call Main in the script instead.
So what we are doing here is we're trying to return an array here and then we can make a new call to
another function pass in the array so we can go through each of the homes URLs.
And the reason I'm making a function is because we need to use I want to use the await keyword and we
can't use the await keyword outside in the global scope.
So let's try and run it and see if it's still working.
And we seem to be getting a nice list of URLs for the different rooms in the Airbnb site.
One thing to notice is that we need to have a Https in front of the links so or else the puppeteer browser
is not going to accept the URLs if you pass them in.
So we need to change this one up here where it returns the element of your URLs.
We need to change that and put in Https in front like this and we should be good to go.
So I'm just going to run it once more and we should see https in front of the URLs.
And there we go.
So now we're getting all the URLs and it's ready to be passed into our next function where we're going
to go into the description pages, all of these different pages.