Skip to content

Commit df09d77

Browse files
committed
fix: explain why we're suddenly talking about 'nodes'
1 parent f4a99d2 commit df09d77

File tree

1 file changed

+2
-0
lines changed
  • sources/academy/webscraping/web_scraping_for_beginners/data_extraction

1 file changed

+2
-0
lines changed

sources/academy/webscraping/web_scraping_for_beginners/data_extraction/using_devtools.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ It will return a `NodeList` (a type of array) with many results. Expand the resu
7777

7878
Naturally, this is the method we use mostly in web scraping, because we're usually interested in scraping all the products from a page, not just a single product.
7979

80+
> The list is called a `NodeList`, because HTML document is understood by the browser as a tree of nodes. Most of the nodes are HTML elements, but there can be also text nodes for plain text, and others.
81+
8082
## How to choose good selectors {#choose-good-selectors}
8183

8284
There are always multiple ways to select an element using CSS selectors. Try to choose selectors that are **simple**, **human-readable**, **unique** and **semantically connected** to the data. Selectors that meet these criteria are sometimes called **resilient selectors**, because they're the most reliable and least likely to change with website updates. If you can, avoid randomly generated attributes like `class="F4jsL8"`. They change often and without warning.

0 commit comments

Comments
 (0)