Compare commits

..

2 commits

Author SHA1 Message Date
47aaa52320 Fix item_number including &SoldByNewegg=1 suffix
Truncate at the first & when extracting the item number from the URL.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 15:37:11 +01:00
052b598069 Fix sqlite3 date adapter deprecation warning
Pass today.isoformat() explicitly instead of relying on the default
date adapter, deprecated since Python 3.12.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 15:35:17 +01:00

View file

@ -225,7 +225,7 @@ def parse_page(filename: str) -> list[Item]:
for item in root.xpath("//div[contains(@class, 'item-container')]"): for item in root.xpath("//div[contains(@class, 'item-container')]"):
title_link = item.find('.//a[@class="item-title"]') title_link = item.find('.//a[@class="item-title"]')
href = title_link.get("href") href = title_link.get("href")
item_number = href[href.find("Item=") + 5 :] item_number = href[href.find("Item=") + 5 :].split("&")[0]
title = title_link.text_content() title = title_link.text_content()
# compare = item.find('.//div[@class="item-compare-box"]//input') # compare = item.find('.//div[@class="item-compare-box"]//input')
@ -368,7 +368,7 @@ def record_prices(data: list[Grouped], today: date) -> None:
VALUES (?, ?, ?, ?, ?, ?) VALUES (?, ?, ?, ?, ?, ?)
""", """,
(item["number"], item["title"], item["size_gb"], (item["number"], item["title"], item["size_gb"],
item["price"], cat["name"], today), item["price"], cat["name"], today.isoformat()),
) )
conn.commit() conn.commit()
conn.close() conn.close()