Now, one more thing I want to show you before we move on to our first real world scraper, where we
scrape Craigslist site.
I'm going to show you one more thing you can use to select elements inside jQuery, and that is attributes.
So if we select this element here, we can see that it has an attribute saying data customer with the
customer number here.
And let's imagine that we have well, we have these two H1 classes.
They both have the class of red.
So if you only wanted the last element here, the only way to select it is by taking in this attribute
as well.
So let's see how we can do that.
You can simply double click on this attribute here and say, Copy.
Then you can first inject jQuery.
And then put a dollar sign and then use single quotes instead and a square bracket first and then end
it with a square bracket and then end it with a single quote and then put in the text.
So now we are selecting an element with this attribute instead.
And notice we had to use single quotes because we had double quotes in here.
You could also switch switch it around so that you have double quotes here and single quotes in here.
As long as you are, as long as you are consistent about it.
So that's how you select elements with an attribute.
If you don't want to make it for an attribute with a particular value like this one and you just want
to select all elements with this attribute, you can simply say dollar sign and say data customer.
And then say that text.
So now we select all the elements with this attribute and not just the ones with the specific value.
So now I think it's been enough practice on my little local sites and I think we should try and have
fun with the actual real world site such as Craigslist.
So I'll see you in the next sections and I hope you have lots of fun with this.