Skip to content

Commit c056906

Browse files
committed
style: condense and fix the solutions markup
1 parent 9901553 commit c056906

File tree

14 files changed

+2
-53
lines changed

14 files changed

+2
-53
lines changed

sources/academy/webscraping/scraping_basics_javascript/05_parsing_html.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,5 @@ Use the same URL as in the previous exercise, but this time print a total count
195195

196196
<details>
197197
<summary>Solution</summary>
198-
199198
<CodeBlock language="js">{F1AcademyDriversExercise.code}</CodeBlock>
200-
201199
</details>

sources/academy/webscraping/scraping_basics_javascript/06_locating_elements.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ Djibouti
242242

243243
<details>
244244
<summary>Solution</summary>
245-
246245
<CodeBlock language="js">{WikipediaCountriesExercise.code}</CodeBlock>
247246

248247
Because some rows contain [table headers](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th), we skip processing a row if `table_row.select("td")` doesn't find any [table data](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td) cells.
@@ -264,9 +263,7 @@ You may want to check out the following pages:
264263

265264
<details>
266265
<summary>Solution</summary>
267-
268266
<CodeBlock language="js">{WikipediaCountriesSingleSelectorExercise.code}</CodeBlock>
269-
270267
</details>
271268

272269
### Scrape F1 news
@@ -288,7 +285,5 @@ Max Verstappen wins Canadian Grand Prix: F1 – as it happened
288285

289286
<details>
290287
<summary>Solution</summary>
291-
292288
<CodeBlock language="js">{GuardianF1TitlesExercise.code}</CodeBlock>
293-
294289
</details>

sources/academy/webscraping/scraping_basics_javascript/07_extracting_data.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ Denon AH-C720 In-Ear Headphones | 236
243243

244244
<details>
245245
<summary>Solution</summary>
246-
247246
<CodeBlock language="js">{WarehouseUnitsExercise.code}</CodeBlock>
248247

249248
:::tip Conditional (ternary) operator
@@ -260,7 +259,6 @@ Simplify the code from previous exercise. Use [regular expressions](https://deve
260259

261260
<details>
262261
<summary>Solution</summary>
263-
264262
<CodeBlock language="js">{WarehouseUnitsRegexExercise.code}</CodeBlock>
265263

266264
:::tip Conditional (ternary) operator
@@ -300,7 +298,5 @@ Hamilton reveals distress over ‘devastating’ groundhog accident at Canadian
300298

301299
<details>
302300
<summary>Solution</summary>
303-
304301
<CodeBlock language="js">{GuardianPublishDatesExercise.code}</CodeBlock>
305-
306302
</details>

sources/academy/webscraping/scraping_basics_javascript/08_saving_data.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,7 @@ Write a new Node.js program that reads the `products.json` file we created in th
211211

212212
<details>
213213
<summary>Solution</summary>
214-
215214
<CodeBlock language="js">{ProcessProductsJsonExercise.code}</CodeBlock>
216-
217215
</details>
218216

219217
### Process your CSV

sources/academy/webscraping/scraping_basics_javascript/09_getting_links.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,7 @@ https://en.wikipedia.org/wiki/Botswana
344344

345345
<details>
346346
<summary>Solution</summary>
347-
348347
<CodeBlock language="js">{WikipediaCountryLinksExercise.code}</CodeBlock>
349-
350348
</details>
351349

352350
### Scrape links to F1 news
@@ -369,7 +367,6 @@ https://www.theguardian.com/sport/article/2024/sep/02/max-verstappen-damns-his-u
369367

370368
<details>
371369
<summary>Solution</summary>
372-
373370
<CodeBlock language="js">{GuardianF1LinksExercise.code}</CodeBlock>
374371

375372
Note that some cards contain two links. One leads to the article, and one to the comments. If we selected all the links in the list by `#maincontent ul li a`, we would get incorrect output like this:

sources/academy/webscraping/scraping_basics_javascript/10_crawling.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,7 @@ Locating cells in tables is sometimes easier if you know how to [filter](https:/
239239

240240
<details>
241241
<summary>Solution</summary>
242-
243242
<CodeBlock language="js">{WikipediaCallingCodesExercise.code}</CodeBlock>
244-
245243
</details>
246244

247245
### Scrape authors of F1 news articles
@@ -272,7 +270,5 @@ PA Media: Lewis Hamilton reveals lifelong battle with depression after school bu
272270

273271
<details>
274272
<summary>Solution</summary>
275-
276273
<CodeBlock language="js">{GuardianF1AuthorsExercise.code}</CodeBlock>
277-
278274
</details>

sources/academy/webscraping/scraping_basics_javascript/11_scraping_variants.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,5 @@ At the time of writing, the shortest article on the CNN Sports homepage is [abou
411411

412412
<details>
413413
<summary>Solution</summary>
414-
415414
<CodeBlock language="js">{CnnSportsShortestArticleExercise.code}</CodeBlock>
416-
417415
</details>

sources/academy/webscraping/scraping_basics_javascript/12_framework.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -424,9 +424,7 @@ If you export the dataset as JSON, it should look something like this:
424424

425425
<details>
426426
<summary>Solution</summary>
427-
428427
<CodeBlock language="js">{CrawleeF1DriversExercise.code}</CodeBlock>
429-
430428
</details>
431429

432430
### Use Crawlee to find the ratings of the most popular Netflix films
@@ -483,7 +481,5 @@ When navigating to the first IMDb search result, you might find it helpful to kn
483481

484482
<details>
485483
<summary>Solution</summary>
486-
487484
<CodeBlock language="js">{CrawleeNetflixRatingsExercise.code}</CodeBlock>
488-
489485
</details>

sources/academy/webscraping/scraping_basics_python/05_parsing_html.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,7 @@ https://www.f1academy.com/Racing-Series/Teams
133133

134134
<details>
135135
<summary>Solution</summary>
136-
137136
<CodeBlock language="py">{F1AcademyTeamsExercise.code}</CodeBlock>
138-
139137
</details>
140138

141139
### Scrape F1 Academy drivers
@@ -144,7 +142,5 @@ Use the same URL as in the previous exercise, but this time print a total count
144142

145143
<details>
146144
<summary>Solution</summary>
147-
148145
<CodeBlock language="py">{F1AcademyDriversExercise.code}</CodeBlock>
149-
150146
</details>

sources/academy/webscraping/scraping_basics_python/06_locating_elements.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ Djibouti
247247

248248
<details>
249249
<summary>Solution</summary>
250-
251250
<CodeBlock language="py">{WikipediaCountriesExercise.code}</CodeBlock>
252251

253252
Because some rows contain [table headers](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th), we skip processing a row if `table_row.select("td")` doesn't find any [table data](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td) cells.
@@ -269,9 +268,7 @@ You may want to check out the following pages:
269268

270269
<details>
271270
<summary>Solution</summary>
272-
273271
<CodeBlock language="py">{WikipediaCountriesSingleSelectorExercise.code}</CodeBlock>
274-
275272
</details>
276273

277274
### Scrape F1 news
@@ -293,7 +290,5 @@ Max Verstappen wins Canadian Grand Prix: F1 – as it happened
293290

294291
<details>
295292
<summary>Solution</summary>
296-
297293
<CodeBlock language="py">{GuardianF1TitlesExercise.code}</CodeBlock>
298-
299294
</details>

0 commit comments

Comments
 (0)