WEBVTT

00:01.250 --> 00:06.200
Okay, let's write our first index.js file.

00:07.880 --> 00:08.870
So.

00:08.870 --> 00:12.470
And then we will import the puppeteer

00:14.900 --> 00:15.950
using require.

00:19.330 --> 00:19.890
And.

00:19.990 --> 00:20.470
Cheerio.

00:23.040 --> 00:23.180
Right

00:26.090 --> 00:30.800
now, the first page we are going to go into is this one.

00:32.930 --> 00:34.850
And let's see how it looks like.

00:39.090 --> 00:40.140
Looks like this.

00:40.140 --> 00:48.570
Actually, if we go down to number two here, then there should be some kind of offset.

00:49.170 --> 00:49.890
Yeah.

00:49.890 --> 00:51.960
So you can see there's an offset here.

00:51.960 --> 00:56.340
So that means there's 18 homes shown on each page.

00:56.370 --> 00:57.860
On each page.

00:57.870 --> 01:05.910
So if we write 36 instead, we go to basically page three instead.

01:07.350 --> 01:08.040
So.

01:13.820 --> 01:16.130
Yeah, you can see we're on page three now.

01:16.130 --> 01:25.580
So the idea is that we go to this URL here and we just bump it up by 18 each time each cycle we go through.

01:25.820 --> 01:34.190
So let's say this as a comment right here and then I want to define exactly what we are going to scrape.

01:34.190 --> 01:42.410
So I'm going to just make a sample here and we're going to get I know I said it before, but I just

01:42.410 --> 01:46.190
want to make it clear how the object is going to look like.

01:46.190 --> 01:54.440
So we have a guest, for example, has a number one, we have a bedrooms, has a one.

01:55.480 --> 01:55.760
Um.

01:57.530 --> 02:02.570
Betts also has the number one and a bass.

02:02.600 --> 02:05.450
We have one now.

02:05.450 --> 02:07.580
In this case it has a shared bath.

02:07.610 --> 02:09.010
Also this one.

02:09.020 --> 02:11.270
Some of them just have bathrooms.

02:11.270 --> 02:16.340
But we're just going to keep it simple for now and just have it as bath.

02:16.970 --> 02:19.900
So then we have the price.

02:19.910 --> 02:23.600
In this case, it's in my local currency where I'm at.

02:23.600 --> 02:33.290
So it's crowns, it's crowns, kroner, maybe it's USD or or Japanese yen where you are, I don't know.

02:33.290 --> 02:40.400
But for me it's kroner right now, so I will call it kroner per night.

02:40.760 --> 02:43.250
And in this case, it's 350.

02:44.030 --> 02:51.290
Okay, so that's what we are going to scrape from each of these rooms or homes in here.

02:52.070 --> 02:52.490
Okay.

02:52.490 --> 03:00.270
In the next section, we are going to go into this page load it into puppeteer and get all of the URLs

03:00.270 --> 03:02.280
we see on this page here.
