WEBVTT

00:00.830 --> 00:09.290
Okay, so now we get to the part where we open the movie Poster girl inside of Nightmare JS to render

00:09.290 --> 00:11.540
the image and get the image URL.

00:12.290 --> 00:15.530
So we need to get the nightmare.

00:17.000 --> 00:22.520
Uh, with a pick n using require nightmare.

00:23.830 --> 00:32.780
And then we get a nightmare instance using Nightmare with a show set to true.

00:32.800 --> 00:37.120
So we see the browser window just for debugging purposes at least.

00:37.690 --> 00:50.200
And then we are going to make another function which we call, let's call it get poster image URL,

00:51.370 --> 00:54.700
and we pass in the movies array inside here.

00:55.120 --> 01:03.280
So we are going to get another property which is called poster image URL.

01:03.580 --> 01:09.460
And that's basically the image we see inside of the image viewer in here.

01:11.520 --> 01:22.110
So if we go in here and we see open image in new tab, we get this URL for a image that is stored on

01:22.110 --> 01:27.630
Amazon and that's what we want to fetch in the end.

01:29.010 --> 01:36.240
So in order to get this image, we now need to find a CSS selector we can use.

01:37.110 --> 01:39.090
Um, let's go inside.

01:39.090 --> 01:40.770
Chrome Developer Tools.

01:42.390 --> 01:44.850
And select just the image.

01:45.720 --> 01:51.300
And we can right click on the image here and say, Copy selector.

01:52.030 --> 01:56.770
And let's look how the selector looks now.

01:56.800 --> 02:06.130
In this particular case, I am okay with just using this long selector or this long selector because

02:06.130 --> 02:15.190
it doesn't really have any distinct, um, elements or classes or so on that I can use to get exactly

02:15.190 --> 02:16.030
this image.

02:16.030 --> 02:23.920
So I'm going to keep it as it is right now and it's working fine to get the poster image that we want.

02:24.490 --> 02:27.640
I can also show you how it works in another page.

02:27.640 --> 02:30.040
Here we have Ready Player one.

02:30.040 --> 02:37.600
So if I use the same CSS selector in here, I also get the full resolution image of the poster.

02:38.440 --> 02:47.500
Now with that, in the next section, we are going to flesh out our function in here to scrape using

02:47.500 --> 02:48.700
nightmare JS.
