Skip to content

Commit d65b249

Browse files
committed
fix: use admonitions
1 parent a39d5ab commit d65b249

File tree

1 file changed

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

1 file changed

+10
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ It will produce a result like this, but it **won't be** the Sony subwoofer.
5757

5858
![Query a selector with JavaScript](./images/devtools-collection-query.png)
5959

60-
> In the screenshot, there is a missing semicolon `;` at the end of the line. In JavaScript, semicolons are optional, so it makes no difference.
60+
:::note About the missing semicolon
61+
62+
In the screenshot, there is a missing semicolon `;` at the end of the line. In JavaScript, semicolons are optional, so it makes no difference.
63+
64+
:::
6165

6266
When we look more closely by hovering over the result in the Console, we find that instead of the Sony subwoofer, we found a JBL Flip speaker. Why? Because earlier we explained that `document.querySelector('.product-item')` finds the **first element** with the `product-item` class, and the JBL speaker is the first product in the list.
6367

@@ -77,7 +81,11 @@ It will return a `NodeList` (a type of array) with many results. Expand the resu
7781

7882
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.
7983

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.
84+
:::note Elements or nodes?
85+
86+
The list is called a `NodeList`, because browsers understand a HTML document as a tree of nodes. Most of the nodes are HTML elements, but there can be also text nodes for plain text, and others.
87+
88+
:::
8189

8290
## How to choose good selectors {#choose-good-selectors}
8391

0 commit comments

Comments
 (0)