mirror of
https://github.com/R0m1k3/Priceflow.git
synced 2026-10-17 12:18:17 +02:00
feat: Implement scheduled item checks with AI price extraction, database updates, and price change notifications.
This commit is contained in:
1 parent
93d73dbed8
commit
2710388faf
2 files changed
+9
-9
No files matched your search
@@ -103,12 +103,12 @@ async def process_item_check(item_id: int):
|
||||
|
||||
try:
|
||||
logger.info(f"Checking item: {item_data['name']} ({item_data['url']})")
|
||||
# Use new browserless service
|
||||
# Note: smart_scroll is handled internally by browserless_service
|
||||
screenshot_path, page_text = await browserless_service.get_page_content(
|
||||
# Use browserless service with extract_text=True for monitoring
|
||||
page_text, screenshot_path = await browserless_service.get_page_content(
|
||||
item_data["url"],
|
||||
use_proxy="amazon" in item_data["url"], # Simple heuristic for now
|
||||
wait_selector=item_data["selector"]
|
||||
use_proxy="amazon" in item_data["url"],
|
||||
wait_selector=item_data["selector"],
|
||||
extract_text=True # Get visible text for AI analysis
|
||||
)
|
||||
|
||||
# Determine availability based on content presence
|
||||
|
||||
@@ -68,7 +68,7 @@ class NewSearchService:
|
||||
# Use proxy if required by config
|
||||
use_proxy = config.get("requires_proxy", False)
|
||||
|
||||
_, html_content = await browserless_service.get_page_content(
|
||||
html_content, _ = await browserless_service.get_page_content(
|
||||
search_url,
|
||||
use_proxy=use_proxy,
|
||||
wait_selector=config.get("wait_selector")
|
||||
@@ -96,7 +96,7 @@ class NewSearchService:
|
||||
use_proxy = config.get("requires_proxy", False) if config else False
|
||||
|
||||
# Use browserless to get content and screenshot
|
||||
screenshot_path, html = await browserless_service.get_page_content(
|
||||
html, screenshot_path = await browserless_service.get_page_content(
|
||||
result.url,
|
||||
use_proxy=use_proxy,
|
||||
wait_selector=None
|
||||
@@ -140,7 +140,7 @@ class NewSearchService:
|
||||
# Use proxy if required by config
|
||||
use_proxy = config.get("requires_proxy", False)
|
||||
|
||||
_, html_content = await browserless_service.get_page_content(
|
||||
html_content, _ = await browserless_service.get_page_content(
|
||||
search_url,
|
||||
use_proxy=use_proxy,
|
||||
wait_selector=config.get("wait_selector")
|
||||
@@ -285,7 +285,7 @@ class NewSearchService:
|
||||
# Use proxy if required by config
|
||||
use_proxy = config.get("requires_proxy", False)
|
||||
|
||||
_, html_content = await browserless_service.get_page_content(
|
||||
html_content, _ = await browserless_service.get_page_content(
|
||||
search_url,
|
||||
use_proxy=use_proxy,
|
||||
wait_selector=config.get("wait_selector")
|
||||
|
||||
Reference in new issue
Block a user