WEBVTT

00:00.740 --> 00:01.760
Okay, everyone.

00:01.760 --> 00:03.530
I hope you gave it a little.

00:03.530 --> 00:07.670
Try to try and get the job description text in here.

00:07.670 --> 00:13.430
And now I'm going to show you how simple this to get the job description text.

00:14.000 --> 00:20.450
We just I'm just going to go and select, inspect the element and click on the text here.

00:20.720 --> 00:28.430
And here we can see that it is a HTML section element with an ID of posting body.

00:28.910 --> 00:38.240
Now, until now we have mostly been using CSS classes to select elements which is have which has a dot

00:38.240 --> 00:41.420
in front of the class name.

00:41.420 --> 00:49.280
But now since we're using a CSS ID, we need to have the hashtag sign in front to select it.

00:49.550 --> 00:55.520
So by that I mean you just need to write out the dollar sign and then posting body.

00:56.730 --> 00:57.930
Dot text.

00:59.220 --> 01:02.640
And then we get all of the text of this element.

01:03.540 --> 01:11.370
So remember to use the hashtag sign when you are selecting an element by the ID, And now we can use

01:11.370 --> 01:19.800
this then to select all of the job description text and put it on to the element or the object as a

01:19.800 --> 01:21.690
job description Property.

01:22.860 --> 01:24.480
So let's go ahead here.

01:24.480 --> 01:31.110
And then inside the loop, we will say we first need to load the HTML into Cheerio.

01:31.110 --> 01:37.560
So we say const dollar sign equals cheerio load HTML.

01:38.250 --> 01:43.050
And that's the same process as we did up here for scraping the listings.

01:43.560 --> 01:51.300
Now we're just doing it for each of the pages with the job descriptions and then we can say const posting

01:51.300 --> 01:51.990
body.

01:53.430 --> 01:57.570
Or we can just say const job description.

02:00.140 --> 02:02.150
Equals dollar sign.

02:02.150 --> 02:13.280
And then we select the posting body and take the text from it, and then we can say and attach this

02:13.280 --> 02:18.140
property onto the listings object so we can say listings.

02:18.830 --> 02:23.690
On the I index, we can say the job description equals job description.

02:24.170 --> 02:25.130
So there we go.

02:25.130 --> 02:30.520
Now we should have all of the job descriptions onto these different listings.

02:30.530 --> 02:39.170
And let's let's also do let's also do a console log here of the listings job description, just to check

02:39.170 --> 02:41.750
if we are getting the right values in.

02:42.410 --> 02:45.410
So now let's try and run it inside Node.

02:50.650 --> 02:55.390
And you can see that it's going through each of these job descriptions.

02:55.390 --> 03:02.650
And if we look inside of the console, I can see there's a printout of all the job descriptions.

03:03.230 --> 03:07.010
So it all looks to be good up and running now.

03:07.010 --> 03:13.100
And we are still waiting one second between each request so we don't get blocked from using Craigslist.

03:13.830 --> 03:20.340
Now the next section, we are going to scrape the compensation from each of these job descriptions,

03:20.340 --> 03:22.170
the one we have right here.

03:22.200 --> 03:28.050
Again, I recommend you try and give it a go as a little exercise to try and scrape this compensation

03:28.050 --> 03:28.830
yourself.

03:28.830 --> 03:32.550
And then in the next section I'm going to show you how I would do it.

03:32.550 --> 03:35.040
So I'll see you in the next section.
