mirror of
https://github.com/R0m1k3/Priceflow.git
synced 2026-10-11 17:29:14 +02:00
feat: Implement improved search service with supporting models, schemas, and API routers, and refactor site verification script.
This commit is contained in:
1 parent
4720ed6b93
commit
9855040f3e
21 files changed
+57932
-419
No files matched your search
@@ -0,0 +1,29 @@
|
||||
from bs4 import BeautifulSoup
|
||||
import sys
|
||||
|
||||
try:
|
||||
with open("/app/debug_dumps/stokomani.fr_failed_verification.html", "r", encoding="utf-8") as f:
|
||||
content = f.read()
|
||||
|
||||
print(f"Read {len(content)} bytes")
|
||||
|
||||
soup = BeautifulSoup(content, "html.parser")
|
||||
print("Soup created")
|
||||
|
||||
selector = "div.product-card"
|
||||
items = soup.select(selector)
|
||||
print(f"Found {len(items)} items with selector '{selector}'")
|
||||
|
||||
if items:
|
||||
item = items[0]
|
||||
print("First item classes:", item.get("class"))
|
||||
|
||||
title_selector = "h3.product-card__title a"
|
||||
title_el = item.select_one(title_selector)
|
||||
if title_el:
|
||||
print("Title found:", title_el.get_text(strip=True))
|
||||
else:
|
||||
print(f"Title NOT found with '{title_selector}'")
|
||||
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
Reference in new issue
Block a user