Spaces:
Running
Running
Commit ·
2161b4a
1
Parent(s): 2c76fa0
add the streamlit visa eimigrasi
Browse files- src/visa_scraper.py +11 -1
src/visa_scraper.py
CHANGED
|
@@ -275,7 +275,17 @@ class IndonesianVisaScraper:
|
|
| 275 |
|
| 276 |
# The value is in the next sibling block
|
| 277 |
next_block = parent_block.find_next_sibling()
|
| 278 |
-
value =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 279 |
|
| 280 |
if 'stay' in heading_text:
|
| 281 |
summary['stay'] = value
|
|
|
|
| 275 |
|
| 276 |
# The value is in the next sibling block
|
| 277 |
next_block = parent_block.find_next_sibling()
|
| 278 |
+
value = "Not specified"
|
| 279 |
+
if next_block:
|
| 280 |
+
list_items = next_block.find_all('li')
|
| 281 |
+
if list_items:
|
| 282 |
+
# If the value is a list, clean each item and join with a line break
|
| 283 |
+
cleaned_items = [s.get_text(strip=True).replace('(Extendable)', '').strip() for s in list_items if s.get_text(strip=True)]
|
| 284 |
+
value = "<br>".join(cleaned_items)
|
| 285 |
+
else:
|
| 286 |
+
# Otherwise, get text from the whole block and clean it
|
| 287 |
+
raw_text = next_block.get_text(separator=' ', strip=True)
|
| 288 |
+
value = raw_text.replace('(Extendable)', '').strip()
|
| 289 |
|
| 290 |
if 'stay' in heading_text:
|
| 291 |
summary['stay'] = value
|