Update extract.py
Browse files- extract.py +4 -0
extract.py
CHANGED
|
@@ -76,11 +76,15 @@ def scrape_vehicle(driver):
|
|
| 76 |
current_section = None
|
| 77 |
for row in rows:
|
| 78 |
cols = row.find_elements(By.TAG_NAME, "p")
|
|
|
|
| 79 |
texts = [col.text.strip() for col in cols if col.text.strip()]
|
|
|
|
| 80 |
if not texts:
|
| 81 |
continue
|
| 82 |
|
| 83 |
label = texts[0].lower()
|
|
|
|
|
|
|
| 84 |
|
| 85 |
if "total" in label:
|
| 86 |
current_section = "total"
|
|
|
|
| 76 |
current_section = None
|
| 77 |
for row in rows:
|
| 78 |
cols = row.find_elements(By.TAG_NAME, "p")
|
| 79 |
+
print("[COLUMNS]", cols)
|
| 80 |
texts = [col.text.strip() for col in cols if col.text.strip()]
|
| 81 |
+
print("[TEXTS]", texts)
|
| 82 |
if not texts:
|
| 83 |
continue
|
| 84 |
|
| 85 |
label = texts[0].lower()
|
| 86 |
+
|
| 87 |
+
print("[LABEL]", label)
|
| 88 |
|
| 89 |
if "total" in label:
|
| 90 |
current_section = "total"
|