Hi, everyone, and welcome back.
I want to take a quick look to help reinforce the concept of traversing or walking the elements on the
dam, and you might have heard me mention traverse or walking the dog, walking the elements on a Web
page to think about this.
As we saw in the inspector, we can see elements on the Web page that served to us and we can see that
they would almost be in the sense of a tree where we're able to walk through the nodes to traverse this.
So if we bring up the inspector.
We can see the documents served to us, we'll see the HTML element, and then we can iterate and walk
down this tree through the nodes of each specific elements, whether that is a div tag or a paragraph
or list items, and also parent, child and sibling elements.
And this is used to describe relationship between elements on the page.
So the main takeaway is that with this each HTML served to us.
When we visit the Web page, we can inspect the HTML code.
And this is the DOM that we're seeing this document that we can use to walk through.
So maybe we're going to be able to grab all age ones or we want this text that's within each one.
So we'd be able to traverse this document down through the H1 to grab that text.
This knowledge, combined with the inspector really allows us to expand our screening capabilities and
helps us find those specifics, since we can scrape the entire website and retrieve that information.
But that's really not what we want to do.
We're looking for specific texts.
In most cases, we're looking to scrape information based on selectors.
I will also leave this website linked in an article under this as a resource from this lecture.
If you guys want to take a further look, I hope that this is starting to make sense.
And when we start working the practical hands on S., it's definitely going to become more clear.
I think that's one of the best ways to learn is to start building.
So let's wrap this up and I'll see you in the next lecture.