fix: "No HTML element found using CSS selector" during ad download (#594)

This commit is contained in:
Heavenfighter
2025-08-06 15:15:11 +02:00
committed by GitHub
parent 9556fc2a91
commit 6b29b9d314
2 changed files with 2 additions and 2 deletions

View File

@@ -189,7 +189,7 @@ class AdExtractor(WebScrapingMixin):
# Extract references using the CORRECTED selector
try:
page_refs = [
(await self.web_find(By.CSS_SELECTOR, "div.manageitems-item-ad h3 a.text-onSurface", parent = li)).attrs["href"]
(await self.web_find(By.CSS_SELECTOR, "div h3 a.text-onSurface", parent = li)).attrs["href"]
for li in list_items
]
refs.extend(page_refs)

View File

@@ -392,7 +392,7 @@ class TestAdExtractorNavigation:
call(By.ID, "my-manageitems-adlist"),
call(By.CSS_SELECTOR, ".Pagination", timeout = 10),
call(By.ID, "my-manageitems-adlist"),
call(By.CSS_SELECTOR, "div.manageitems-item-ad h3 a.text-onSurface", parent = cardbox_mock),
call(By.CSS_SELECTOR, "div h3 a.text-onSurface", parent = cardbox_mock),
], any_order = False) # Check order if important
mock_web_find_all.assert_has_calls([