chore: sync project files

This commit is contained in:
Gilles Soulier
2026-01-13 19:49:04 +01:00
parent 53f8227941
commit ecda149a4b
149 changed files with 65272 additions and 1 deletions

43
test_backmarket_parser.py Executable file
View File

@@ -0,0 +1,43 @@
#!/usr/bin/env python3
"""Test rapide du parser Backmarket avec la fixture."""
from pricewatch.app.stores.backmarket.store import BackmarketStore
# Charger la fixture
with open("scraped/backmarket_pw.html", "r", encoding="utf-8") as f:
html = f.read()
url = "https://www.backmarket.fr/fr-fr/p/iphone-15-pro"
store = BackmarketStore()
snapshot = store.parse(html, url)
print("=" * 80)
print("TEST PARSER BACKMARKET")
print("=" * 80)
print(f"\nSource: {snapshot.source}")
print(f"URL: {snapshot.url}")
print(f"Reference: {snapshot.reference}")
print(f"Title: {snapshot.title}")
print(f"Price: {snapshot.price} {snapshot.currency}")
print(f"Stock: {snapshot.stock_status}")
print(f"Images: {len(snapshot.images)} images")
for i, img in enumerate(snapshot.images[:3]):
print(f" [{i+1}] {img[:80]}")
print(f"Category: {snapshot.category}")
print(f"Specs: {len(snapshot.specs)} specs")
for key, value in list(snapshot.specs.items())[:5]:
print(f" - {key}: {value}")
print(f"\nDebug status: {snapshot.debug.status}")
print(f"Debug errors: {len(snapshot.debug.errors)}")
for err in snapshot.debug.errors:
print(f" - {err}")
print(f"Debug notes: {len(snapshot.debug.notes)}")
for note in snapshot.debug.notes:
print(f" - {note}")
print(f"\nIs complete: {snapshot.is_complete()}")
print("=" * 80)