WEBVTT

00:01.580 --> 00:02.270
All right.

00:02.270 --> 00:11.030
So now we got all of the poster URLs, all the pages for the posters that we want to get the image from.

00:11.030 --> 00:18.050
And now I just want to show you why we are going to be using Nightmare JS and not just the regular request

00:18.050 --> 00:20.870
and cheerio that we used before.

00:21.320 --> 00:29.780
So if we go and go inside this page and I have a little extension to disable JavaScript, if I disable

00:29.780 --> 00:34.910
JavaScript and load this page, the page is just going to be all black.

00:35.360 --> 00:43.580
And if we, if you will try and get the page using request, you're going to get some kind of Http error

00:43.580 --> 00:50.060
code because IMDb is using JavaScript to render this page.

00:51.590 --> 00:57.530
Now, you could also maybe go and take a deep dive into the JavaScript code.

00:57.530 --> 00:59.080
I don't know if you could do that.

00:59.090 --> 01:04.130
So find out how they're getting this image in, how they're getting the image.

01:04.130 --> 01:13.130
But for most cases, in this case, I think it's easier to just use Nightmare JS to render the site

01:13.130 --> 01:15.320
and get the image this way.

01:15.320 --> 01:19.010
So we are going to use Nightmare JS to render the site.

01:19.040 --> 01:24.860
We're not going to use Nightmare JS to download it, but we will use it to render the site and get the

01:24.860 --> 01:27.530
URL for the image on this page.

01:27.530 --> 01:32.330
And then after we are going to use request to download the image itself.

01:32.960 --> 01:33.890
All right?

01:34.750 --> 01:36.040
See you in the next section.
