Fix wiki images and ambiguous Unicode #2

Merged
Tirsvad merged 2 commits from feature/modernise-day-48 into main 2026-10-28 08:17:22 +01:00
7 changed files with 12 additions and 12 deletions
Showing only changes of commit 5d66ee785a - Show all commits
+4 -4
View File
@@ -4,7 +4,7 @@
## Trin 1 - Åbn siden
![Forsiden på python.org](images/01-python-org-home.png)
![Forsiden på python.org](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/048-scrapping-python-org/raw/branch/main/docs/screenshots/01-python-org-home.png)
`driver.get("https://www.python.org/")` indlæser siden i Chrome.
@@ -13,7 +13,7 @@ Den skal altid lukkes igen, så den moderne kode bruger `try/finally`.
## Trin 2 - Find widgetten med inspektionsværktøjet
![Widgetten Upcoming Events](images/02-event-widget.png)
![Widgetten Upcoming Events](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/048-scrapping-python-org/raw/branch/main/docs/screenshots/02-event-widget.png)
Højreklik på widgetten og vælg *Inspect*. Begivenhederne ligger i et element med
klassen `event-widget`; hver begivenhed er en `li` med et `time`- og et `a`-tag.
@@ -23,7 +23,7 @@ der rummer præcis de data, du vil have.
## Trin 3 - Vælg de fem listepunkter med en CSS-selector
![De fem listepunkter markeret med rødt](images/03-event-list-highlighted.png)
![De fem listepunkter markeret med rødt](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/048-scrapping-python-org/raw/branch/main/docs/screenshots/03-event-list-highlighted.png)
`driver.find_elements(By.CSS_SELECTOR, ".event-widget li")` returnerer de fem
punkter. En klassebaseret selector er kortere og mere stabil end den lange
@@ -34,7 +34,7 @@ hvornår CSS-selectors slår XPath.
## Trin 4 - Byg dictionary'en
![Den udskrevne dictionary](images/04-output-dictionary.png)
![Den udskrevne dictionary](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/048-scrapping-python-org/raw/branch/main/docs/screenshots/04-output-dictionary.png)
For hvert punkt læser vi `time` og `a` og gemmer dem under punktets indeks, med
`enumerate` i stedet for en manuel tæller.
+4 -4
View File
@@ -4,7 +4,7 @@
## Langkah 1 - Buka laman
![Laman utama python.org](images/01-python-org-home.png)
![Laman utama python.org](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/048-scrapping-python-org/raw/branch/main/docs/screenshots/01-python-org-home.png)
`driver.get("https://www.python.org/")` memuatkan laman dalam Chrome.
@@ -13,7 +13,7 @@ Ia mesti ditutup semula, jadi kod moden menggunakan `try/finally`.
## Langkah 2 - Cari widget dengan alat pemeriksa
![Widget Upcoming Events](images/02-event-widget.png)
![Widget Upcoming Events](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/048-scrapping-python-org/raw/branch/main/docs/screenshots/02-event-widget.png)
Klik kanan pada widget dan pilih *Inspect*. Acara berada dalam elemen berkelas
`event-widget`; setiap acara ialah `li` yang mengandungi teg `time` dan `a`.
@@ -23,7 +23,7 @@ bekas yang menyimpan data yang tepat seperti yang dikehendaki.
## Langkah 3 - Pilih lima item senarai dengan pemilih CSS
![Lima item senarai ditandakan merah](images/03-event-list-highlighted.png)
![Lima item senarai ditandakan merah](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/048-scrapping-python-org/raw/branch/main/docs/screenshots/03-event-list-highlighted.png)
`driver.find_elements(By.CSS_SELECTOR, ".event-widget li")` mengembalikan lima
item. Pemilih berasaskan kelas lebih pendek dan lebih stabil daripada XPath
@@ -34,7 +34,7 @@ pemilih CSS lebih baik daripada XPath.
## Langkah 4 - Bina kamus
![Kamus yang dicetak](images/04-output-dictionary.png)
![Kamus yang dicetak](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/048-scrapping-python-org/raw/branch/main/docs/screenshots/04-output-dictionary.png)
Untuk setiap item kita baca `time` dan `a` lalu simpan di bawah indeks item itu,
dengan `enumerate` dan bukannya pembilang manual.
+4 -4
View File
@@ -4,7 +4,7 @@
## Step 1 - Open the page
![python.org home page](images/01-python-org-home.png)
![python.org home page](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/048-scrapping-python-org/raw/branch/main/docs/screenshots/01-python-org-home.png)
`driver.get("https://www.python.org/")` loads the page in Chrome.
@@ -13,7 +13,7 @@ must always be closed again, so the modern code wraps it in `try/finally`.
## Step 2 - Locate the widget with the inspector
![The Upcoming Events widget](images/02-event-widget.png)
![The Upcoming Events widget](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/048-scrapping-python-org/raw/branch/main/docs/screenshots/02-event-widget.png)
Right-click the widget and choose *Inspect*. The events live inside an element
with the class `event-widget`; each event is an `li` holding a `time` and an
@@ -24,7 +24,7 @@ holds exactly the data you want.
## Step 3 - Select the five list items with a CSS selector
![The five list items outlined in red](images/03-event-list-highlighted.png)
![The five list items outlined in red](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/048-scrapping-python-org/raw/branch/main/docs/screenshots/03-event-list-highlighted.png)
`driver.find_elements(By.CSS_SELECTOR, ".event-widget li")` returns the five
items. A class-based selector is shorter and more stable than the long XPath
@@ -35,7 +35,7 @@ selectors beat XPath.
## Step 4 - Build the dictionary
![The printed dictionary](images/04-output-dictionary.png)
![The printed dictionary](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/048-scrapping-python-org/raw/branch/main/docs/screenshots/04-output-dictionary.png)
For every item we read `time` and `a` and store them under the item's index,
with `enumerate` instead of a manual counter.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB