Hood element.
The text and that should be it.
Now we can just add it as a property onto our result object.
And then let's try and run it inside Node.
And let's see.
So some of the job listings don't have a neighborhood onto them, but that's okay.
We are just having an empty string instead.
But if I go up, I can see already that some of the data is filled out.
We have Los Altos here, San Jose South and so on.
Now, I hope you got to the same point here as I did.
I didn't try to do the exercise.
But there's one more thing I'm going to add on to that I haven't talked about I said I would do, which
is to clean up our data a little bit.
And this is very typical something you have to do when you're doing web scraping.
Sometimes you have to denoise the data.
You're scraping a little bit.
In this case, I mean that there is a space in front of the neighborhood and we have these parent pieces
here.
So how are we going to remove this noise from our data?
I'm going to show you now, so I'm going to copy this string here as an example and go into the console
and show you how we can denoise it.
So let's make an example here.
And it's going to be this one with Los Altos.
And to remove the space in the front and the back, we can use the trim function inside of JavaScript.
Oh, it's called example, not examples.
So by using trim, we remove the space in front here.
So we just get the string without spaces.
But you also need to remove the parent pieces we have here at the beginning and the end.
Now, how do we do that?
Well, we can use something called replace instead.
So I'm going to call another function chain the functions, and say replace.
And then I will put in the character it should find and the one it should replace it with.
So it's going to replace it with an empty string.
Now, if I run it again, I can see that the front parenthesis has been removed.
Now we also need to get the back parenthesis, the one here, so I can just call the replace function
again.
Just like that.
And now I have the much more clean data without the spaces or the parent pieces.
So I'm just going to copy this.
Let's copy that.
I will just.
Take it from here and then we'll just put it next after the text here.
And there we go.
So now I have this chain functions here.
I have the first getting the text of the hood element, then the trim and then the replace.
So now I should have much cleaner data of the website instead.
And now let's try and run it and see how it looks.
And we can see still some of them do not have a neighborhood.
But up here where we can see some of them have Los Altos without any spaces or parenthesis.
So nice clean data is what we usually want to get instead of leaving it up to other guys in the later
layers or int.
We are doing something with our data maybe.
Anyway, that's it for now.
And in the next section we are going to look at how we are going to go through all of these different
job URLs and go into their job description and get the job description and perhaps also the compensation
that are filling out.
So I'll see you in the next section.