Hi and welcome back.
So from the previous videos, we are actually trying to build a recommendation system and we succeeded
in getting a movie name from the user after getting that name we hit on the IMDB website and try to
get the list of the movie names and then look for our users movie name in that list.
And if that list contains the movie name, we don't do that.
And after getting to that movie page, we extracted the director's name and then he can't do that.
Now, in this session, we will try to extract the information, the top four movies of their director
and recommend that to our user.
So.
This was the movie page, and when we get to the director will hit on that and this was the director page
Now what we are looking for is we want these four movies, right.
So let's just get back to the ide again.
We will be doing the same thing.
Let's just cut this out.
So this section is responsible for taking them from the user, then extracting the IMDB movies and then
creating a soup and doing all that stuff and checking that if the user entered movie name is in the
IMDB list or not, and if it is spread, then we are just getting the movie where this chunk is responsible
for extracting that, for hitting on that movie well and extracting the director's information directors
general and director's name.
Now we will try to replicate the same thing, but for extracting the top four movies of their director.
So let's just take this Eurail.
OK.
And over here, let's just based this out for now.
Now, what we have to do is we have to, again, replicate the same thing.
Requests don't get and I want to get to that and.
R e three equals to this thing now I just need to extract the e-mail from them Horia three dot html.
Perfect, so now after getting the XHTML, what I will do is I will create a beautiful soup and then
I will see that what will be the parts for getting these four movies?
So if we go for soup three.
Equals to beautiful soup and then the XHTML.
And then the pastor.
Perfect.
So now, after getting on this, what we have to do, we have to look and look into this, a page that
from where we can extract these four movie names.
So here you can see that this is the movie name.
This is the actual movie patch.
And then if we scroll up a bit, scroll up a bit.
Yeah, so this is the idea if we just shut that down.
So these are the formal release, the first one, the second one, the third one and the fourth one.
So if I narrowed down my scope to this, if I can then certainly look for these movie names.
So let's just do this first.
So, again, what they have to do is previously while we're working, that we encountered classified.
So same rules will be applicable for the IDF.
So again, we have to do that through three dort fine.
So here there is no need for going find all because the idea will only be running throughout the page.
We can certainly go for that idea and putting the fine.
So now we need that deal with the idea of nine four and then let's just assign it known for.
Equal to now, if we just simply for testing, let's just bring down on for stuff.
OK, I think that this should be taxed right?
Sorry, my bad.
So now if I hate it again.
Perfect, I'm getting the response now, what they have to do is I have to iterate on it, I have to
trade on the device and then extract the movie name.
So what I can do, I can do a find all with this thing on that div.
So now what I can do, I can do nine, four, and then my playing on nine four, so it is only applicable
inside this inside this non-negative, it is only applicable on these four stuff.
So now if we go four, nine, four and then go four, find all and then we want that deals with the
class.
This stuff, so it will provide us with the movie names.
What we did is we have done what we did.
Now, what we have to do is we have to extract I trade on that for and then extract the movie names.
So if I know I trade on this for Divx in movie is so for the first iteration, it will provide me Esteve
for the next, it will provide me this for the next, it will provide me this and for the last will
provide me this.
So let's just head on for the first one and the rest will be the same.
So overhead going on the Stav, we want to extract the movie name.
So if we go for the.
Divx dot.
With the movie name.
Yeah, this is so here we can find this thing for the movie name, so let me just copy this and save.
If we close this one.
Perfect.
So now we just want to extract this thing like they've got find and I want to find that div with declasse.
Of this thing, and then let's just say it is.
The.
Movie.
And then if we go for movie dive
Dot string, hopefully.
If we open this thing, if we go down a bit.
Yep, we are heading to this div and then actually we need to go to the anchor tag and then we can go
for that string.
Perfect.
So we go for the a and then we go for the string.
So let's just print this and see what we get.
Perfect, now we are getting all the movie names from here.
This one, this one, this one and this one.
So now uptil here we have seen that how we can hit on this director page and how we can narrow it down
for extracting these movie names.
In the next session, we will try to sink all of these three chunks together.