mirror of
https://github.com/Second-Hand-Friends/kleinanzeigen-bot.git
synced 2026-03-12 02:31:45 +01:00
fix: "No HTML element found using CSS selector" during ad download (#594)
This commit is contained in:
@@ -189,7 +189,7 @@ class AdExtractor(WebScrapingMixin):
|
|||||||
# Extract references using the CORRECTED selector
|
# Extract references using the CORRECTED selector
|
||||||
try:
|
try:
|
||||||
page_refs = [
|
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
|
for li in list_items
|
||||||
]
|
]
|
||||||
refs.extend(page_refs)
|
refs.extend(page_refs)
|
||||||
|
|||||||
@@ -392,7 +392,7 @@ class TestAdExtractorNavigation:
|
|||||||
call(By.ID, "my-manageitems-adlist"),
|
call(By.ID, "my-manageitems-adlist"),
|
||||||
call(By.CSS_SELECTOR, ".Pagination", timeout = 10),
|
call(By.CSS_SELECTOR, ".Pagination", timeout = 10),
|
||||||
call(By.ID, "my-manageitems-adlist"),
|
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
|
], any_order = False) # Check order if important
|
||||||
|
|
||||||
mock_web_find_all.assert_has_calls([
|
mock_web_find_all.assert_has_calls([
|
||||||
|
|||||||
Reference in New Issue
Block a user