Okay, so now we get to the part where we open the movie Poster girl inside of Nightmare JS to render
the image and get the image URL.
So we need to get the nightmare.
Uh, with a pick n using require nightmare.
And then we get a nightmare instance using Nightmare with a show set to true.
So we see the browser window just for debugging purposes at least.
And then we are going to make another function which we call, let's call it get poster image URL,
and we pass in the movies array inside here.
So we are going to get another property which is called poster image URL.
And that's basically the image we see inside of the image viewer in here.
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
Amazon and that's what we want to fetch in the end.
So in order to get this image, we now need to find a CSS selector we can use.
Um, let's go inside.
Chrome Developer Tools.
And select just the image.
And we can right click on the image here and say, Copy selector.
And let's look how the selector looks now.
In this particular case, I am okay with just using this long selector or this long selector because
it doesn't really have any distinct, um, elements or classes or so on that I can use to get exactly
this image.
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.
I can also show you how it works in another page.
Here we have Ready Player one.
So if I use the same CSS selector in here, I also get the full resolution image of the poster.
Now with that, in the next section, we are going to flesh out our function in here to scrape using
nightmare JS.