Skip to content

Commit 4b4cf9d

Browse files
committed
fix: update devtools 2 to be about JS
1 parent 9d590f7 commit 4b4cf9d

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

sources/academy/webscraping/scraping_basics_javascript2/02_devtools_locating_elements.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ The `class` attribute can hold multiple values separated by whitespace. This par
5555

5656
## Programmatically locating a product card
5757

58-
Let's jump into the **Console** and write some JavaScript. Don't worry—we don't need to know the language, and yes, this is a helpful step on our journey to creating a scraper in Python.
59-
60-
In browsers, JavaScript represents the current page as the [`Document`](https://developer.mozilla.org/en-US/docs/Web/API/Document) object, accessible via `document`. This object offers many useful methods, including [`querySelector()`](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector). This method takes a CSS selector as a string and returns the first HTML element that matches. We'll try typing this into the **Console**:
58+
Let's jump into the **Console** and write some code. In browsers, JavaScript represents the current page as the [`Document`](https://developer.mozilla.org/en-US/docs/Web/API/Document) object, accessible via `document`. This object offers many useful methods, including [`querySelector()`](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector). This method takes a CSS selector as a string and returns the first HTML element that matches. We'll try typing this into the **Console**:
6159

6260
```js
6361
document.querySelector('.product-item');
@@ -135,14 +133,14 @@ We'll expand the result by clicking the small arrow, then hover our cursor over
135133

136134
![Highlighting a querySelectorAll() result](./images/devtools-hover-queryselectorall.png)
137135

138-
To save the subwoofer in a variable for further inspection, we can use index access with brackets, just like in Python lists (or JavaScript arrays):
136+
To save the subwoofer in a variable for further inspection, we can use index access with brackets, just like with regular JavaScript arrays:
139137

140138
```js
141139
products = document.querySelectorAll('.product-item');
142140
subwoofer = products[2];
143141
```
144142

145-
Even though we're just playing with JavaScript in the browser's **Console**, we're inching closer to figuring out what our Python program will need to do. In the next lesson, we'll dive into accessing child elements and extracting product details.
143+
Even though we're just playing in the browser's **Console**, we're inching closer to figuring out what our Node.js program will need to do. In the next lesson, we'll dive into accessing child elements and extracting product details.
146144

147145
---
148146

sources/academy/webscraping/scraping_basics_python/02_devtools_locating_elements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ We'll expand the result by clicking the small arrow, then hover our cursor over
135135

136136
![Highlighting a querySelectorAll() result](./images/devtools-hover-queryselectorall.png)
137137

138-
To save the subwoofer in a variable for further inspection, we can use index access with brackets, just like in Python lists (or JavaScript arrays):
138+
To save the subwoofer in a variable for further inspection, we can use index access with brackets, just like with Python lists (or JavaScript arrays):
139139

140140
```js
141141
products = document.querySelectorAll('.product-item');

0 commit comments

Comments
 (0)