Skip to content

Commit e0ac59f

Browse files
authored
feat: update the DevTools 2 lesson of the JS2 course to be about JavaScript (#1655)
A part of #1584
1 parent 6be646e commit e0ac59f

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
@@ -56,9 +56,7 @@ The `class` attribute can hold multiple values separated by whitespace. This par
5656

5757
## Programmatically locating a product card
5858

59-
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.
60-
61-
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**:
59+
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**:
6260

6361
```js
6462
document.querySelector('.product-item');
@@ -136,14 +134,14 @@ We'll expand the result by clicking the small arrow, then hover our cursor over
136134

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

139-
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):
137+
To save the subwoofer in a variable for further inspection, we can use index access with brackets, just like with regular JavaScript arrays:
140138

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

146-
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.
144+
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.
147145

148146
---
149147

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)