WEBVTT

00:01.070 --> 00:09.020
Now let's try and get the the rank of each of the movies and the IMDb rating.

00:09.320 --> 00:19.310
So if we go inside Chrome Developer Tools again and we select an element, we select the IMDb rating

00:20.120 --> 00:22.970
and we look inside here.

00:24.980 --> 00:27.980
We can see there is this rating column.

00:28.130 --> 00:33.830
I'm the B rating and it contains the rating if you pull a text on it.

00:35.180 --> 00:39.950
We can also get some extra information here based on number of user ratings.

00:39.950 --> 00:42.620
But let's just get the rating itself for now.

00:43.190 --> 00:46.040
So we say copy copy selector.

00:47.300 --> 00:53.870
And you can see there's a really long selector here, but I think we can just use this.

00:56.000 --> 00:57.050
Instead.

00:58.760 --> 01:05.630
Now, if we say text, we get a long list of ratings for each of the movies.

01:06.680 --> 01:10.190
So we copy that selector because we can use that.

01:10.700 --> 01:14.900
However, you can't just paste it inside here.

01:14.900 --> 01:22.760
We can't just do we can't just let me just do this.

01:22.880 --> 01:23.750
We can't.

01:25.060 --> 01:26.290
Just select.

01:28.760 --> 01:31.050
I mean, we we can't.

01:32.220 --> 01:34.680
We can't just do this.

01:35.570 --> 01:38.250
Um, well, why can't we just do this, Bill?

01:38.280 --> 01:42.030
Because we are inside of the title column.

01:42.060 --> 01:43.740
The title column.

01:43.740 --> 01:49.700
And, well, the title column does not contain any title.

01:49.710 --> 01:56.220
You can see it is the TR that contains all of these information we want.

01:56.460 --> 02:00.690
But right now we are iterating over the title column inside here.

02:00.840 --> 02:08.250
So we need to go sort of a step back and iterate over TR instead.

02:08.250 --> 02:21.600
And inside here we can get the title by using element dot find and putting in our selector here instead.

02:24.430 --> 02:26.230
I hope that is clear to you.

02:26.230 --> 02:31.330
So we have the title and the IMDb rating we also need to use.

02:32.050 --> 02:34.270
Um, let's see.

02:34.270 --> 02:40.120
We also need to use element here and dot find.

02:43.370 --> 02:44.120
Let's see.

02:46.950 --> 02:50.170
So we iterate over the CR.

02:50.250 --> 02:57.810
Instead we go and find the child element instead of title, column and reading column and get those

02:57.810 --> 02:58.980
values instead.

03:00.150 --> 03:03.960
And we are going to return an object here.

03:06.780 --> 03:10.590
Tune title and IMDb rating.

03:13.700 --> 03:14.180
Yeah.

03:15.650 --> 03:17.330
Let's try and do that.

03:17.360 --> 03:18.710
Let's see how it works.

03:25.440 --> 03:29.010
Okay, so it looks like we get all of the titles.

03:29.010 --> 03:36.630
The ratings look kind of weird, but I think if we just do a trim, we are getting all the white space

03:36.630 --> 03:37.620
from it.

03:37.980 --> 03:42.570
So NodeJS engine and.

03:45.400 --> 03:51.670
Oh, it's because I used trim on the title column instead of the rating.

03:53.550 --> 03:55.860
Just do that on the rating column.

04:01.460 --> 04:02.060
Yeah.

04:02.060 --> 04:03.620
And we get the.

04:04.760 --> 04:09.620
Titles and ratings in a much more nice format this time.

04:10.490 --> 04:14.660
Actually, it looks like the ratings is coming as a string instead.

04:14.660 --> 04:15.470
But that's okay.

04:15.470 --> 04:18.140
We're not really going to use it as a number for now.

04:19.040 --> 04:22.610
Notice also that some of the titles doesn't have a rating.

04:22.610 --> 04:24.950
It's not because there's something wrong with the script.

04:24.950 --> 04:32.810
It's because some of the movies just don't have a rating yet because there are new or there haven't

04:32.810 --> 04:35.540
been, they haven't been released yet and so on.

04:36.670 --> 04:39.910
So everything looks to be working really great.

04:39.940 --> 04:46.810
Now let's get the rank in the next section and maybe also the description URL.
