Have our now second project for Los Angeles Craigslist website.
So the Craigslist website looks like this.
Basically, it is a listing website.
You can list your, you know, vacancies, you can list your ads about your products and stuff like
that.
You can list basically anything like you can see here, real estate, all of the things.
Right.
Uh, so this is for Los Angeles for different places in states.
You can find different here like that.
So you can find for, you know, uh, Chicago, you know, Santa Maria.
So San Diego and stuff like that.
So I'm just using Los Angeles here for an example.
And let's say, uh, we want to check.
I'm just thinking now here.
Let's see.
We want to check what kind of real estate deals are there.
So what we do is we can come here, open it.
And take that as our.
Let us let it load.
So once it's load loaded.
And let me try this without that once.
Just like that.
So it's a real state.
All right.
So what I can do is I can take this as our base URL.
This was already from our last time.
So I don't need that last part here.
So I can take that as our base URL.
So this base URL is for real state Craigslist website.
Cool.
So once we have the Craigslist Craigslist website, what we can do is we can come back here and we can
basically list out all the real estate property deals we have.
And we can do this by basically going here, inspecting the elements.
And let's see all the properties.
Now that's the label.
If we go a little bit ahead and check.
So it has a class class of CL search result.
So that would be something we want.
We want an ally.
Um, actually, just a minute.
We want a URL, and then we want to find.
Yeah.
So what we want is we want to get the div with results class first.
So div results equals soup dot find.
And we want to find a div with attributes of class ID with that.
I think it was a class.
Yeah.
And once we have that div then we want to find div results dot find and or l o l with again attributes
attributes of.
Class.
BDI forecast rate.
BDI forecast.
Let me just check.
Uh, then we have inside there BDI forecast.
Yeah, exactly.
All right.
So once we have that uh, inside that.
So let us then find, uh, this is an oil.
So what we want is inside oil.
We want to find all the allies.
With an attribute of.
Let's see what the attribute is.
The attribute is basically.
Seal search result.
So seal search result.
You can see here.
So we can say class is going to be CL search result.
What we can do is for I in for l I in that what.
So we have each of that list.
Then we can basically get once the title of this li and see the, uh, you know, things.
So what we do come here, print the li dot title.
Let's try this.
Um, I also wanted to, uh, check the results.
How many results are there?
So we can do that later.
Let's try to come here and firstly try this.
It says none type has no attribute.
So it didn't find the diff results at the first hand.
Mhm mhm mhm okay.
Interesting.
Didn't find this part here.
So seal results piece.
Maybe if we did find all it could find something.
Because right now, diff results.
Let's try.
Yeah.
So we didn't found any of that.
Which means.
Making a result ID.
So let's try with search results page one and that as an ID then.
So let's try with different options.
So let's see this here.
Um.
Justin.
Um.
Let's try it with the.
Itself.
Let's see.
Still none.
Let's try to then print the soup first just to check everything works.
Okay.
Uh, yes.
So we have our allies and list.
So all of these lists we need actually.
So let's try to decipher this list a little bit.
It is inside the body tag.
Okay.
Yes, I think it does not need anything like that.
So we can directly come here and look for directly so we can directly look for a class.
Of list.
So right here it's an oil so directly like this.
Also you have to see all these like what is the possible outcome.
If one way doesn't work then we have to try to find another way.
So all of that particular class.
So let's try to find this.
This means div is not there.
So we can forget div.
We can directly come to oil but with soup.
And class is going to be this static.
And once it is there, then we want to find, uh, the class of Li of this same class.
I think that's what we want to do.
So we want to find the Li of the same class, and then we have the title or not.
Let's see.
Uh, we don't have the title, but we have.
Yeah, we have the title.
So let's try to run this thing.
Let's see.
Um.
Um, a little.
Let's.
Let's remove this soup dot prettify once and let's say title.
Okay, so now we have our titles of all the listings that we have, and maybe it would be a good idea
also to have that listings price.
So what I can do is let's see the soup again once.
Where the prices are and how it is structured, then we can know what to do.
Then inside that lie we have a link.
We have a div with a title and we have a div with details.
And inside that div we have price.
So we can use this div with details.
So we can find a div with the details inside.
So I can say li dot.
Find a div with a class.
Class details details.
And this is going to be details div.
And then we have a price div.
So inside here inside this div there is a div with a price.
So let's come here again.
So we find that inside the details div we find with price.
And this is price div.
Once we have the price div then we just take the text of it.
So I can say print the title and the price divs dot text.
So that's how we can decipher and scrape the elements.
So let's see.
Yeah.
So at the end we can see all of the prices.
So we can see here $550,000, $450,000, $3 million.
Right.
Uh $999,000.
So basically we can get, uh, such information.
So, uh, you know, making this information more, having this locations would be your thing to do.
So you can add this as a project, another project that you want to do and add location at, uh, you
know, emails, links and like that.
All right.
And, uh, then after this, uh, I think we are almost finished.
Uh, I so I'll see you in the next, uh, video.