Okay, so now we have all the HTML of the Craigslist page inside of this string variable, but we also
need to be able to select different elements and their values that we want.
And of course, you could use regular expressions maybe, but it's a lot more easy and efficient to
use something like jQuery or in NodeJS case.
Cheerio.
So you can see we use the dollar sign to define the chario loaded page, which is going to enable us
to select all the different elements using CSS selectors.
So let's start out by selecting all the titles of the jobs.
So let's open the Chrome developer tools.
We use Ctrl, Shift I to go into the tools and you can also go inside of the menu inside Google Chrome,
say more tools, Developer tools to access the developer tools.
And then we can select all of the different elements with the icon up here and we can click on them
and then we get inside the Elements menu and see how the HTML look at this specific element.
Well, for example, right here we have the title for the autonomous Technical Autonomous vehicle trainer.
We have a result info class inside of this unordered list with the class rows.
And so each job title and the date and so on is inside this result row or list item which also has the
class result info.
Now inside this p class result info we have all the information we want in the first page.
Let's try first and just define a sample object with all the information that we want to scrape from
this list, just so we get an overview of what we want to get.
So I'm going to call it Scrape with Salt and have a title of the job, for example, technical autonomous
vehicle trainer.
And we're also going to have a description which is a longer text when you click on the link of the
job where there's a long description about the job, the requirements and who they are and so on.
It's all this sex down here.
And then I think we also want the.
Let's see.
Let's see what we should get.
We should get the date and was posted.
Could be interesting to get also.
So I will make that as a JavaScript object.
I mean a JavaScript date object.
Then I think we could also get the URL for the job so you know where you can read the full description
of the job and so on.
See the location, etcetera.
And that is what you can see when you click on the URL in here.
So that's on the first page.
And let's also get the neighborhood that the job is inside or the hood.
And then I think it could also be interesting maybe to get the address of the job.
See the actress over here on the right side.
Main Street.
And I think we also want to get the compensation.
Interesting data to get for all of the jobs.
See which one pays the most.
And of course, remember, this is just a sample so you can see what we're actually going to get.
We're going to get this for every job on this page inside of Craigslist.