Skip to content

Add laptop search script for IVORY and KSP (i5+, 16GB+, 512GB+, ≤3000₪, no-OS)#21

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/search-laptops-no-os
Draft

Add laptop search script for IVORY and KSP (i5+, 16GB+, 512GB+, ≤3000₪, no-OS)#21
Copilot wants to merge 2 commits intomainfrom
copilot/search-laptops-no-os

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 29, 2026

Implements a Python web scraper targeting the Israeli retailers IVORY and KSP, filtering laptop listings by: Intel Core i5+ / AMD Ryzen 5+ CPU, ≥16 GB RAM, ≥512 GB SSD, price ≤3,000 NIS, and no pre-installed Windows (FreeDOS / no OS / Linux all accepted).

New files — 19_laptop_search/

  • laptop_search.py — queries KSP and IVORY JSON catalog APIs, applies all filters, prints results sorted by price. Network errors are caught per-source and reported to stderr without aborting the other source.
  • requirements.txtrequests, beautifulsoup4, lxml
  • test_laptop_search.py — 34 unit tests covering each filter helper and matches_criteria

Key filtering logic

RAM vs SSD disambiguation — naively matching any NGB value would flag the 512 GB SSD as passing the 16 GB RAM check. The fix: require explicit memory keywords (DDR, LPDDR, RAM) first; fall back to bare NGB only for values in the typical RAM range (16–128 GB):

# Explicit keyword match (e.g. "16GB DDR4", "32GB LPDDR5")
for m in re.finditer(r"(\d+)\s*gb\s+(?:ram|ddr\d*|lpddr\d*|memory)", text, re.IGNORECASE):
    if int(m.group(1)) >= 16:
        return True
# Fallback: bare "NGB" only if ≤128 GB (excludes SSD-range values like 512 GB)
for m in re.finditer(r"(\d+)\s*gb(?!\s*(?:ssd|nvme|m\.2|nand|storage|hdd))", text, re.IGNORECASE):
    val = int(m.group(1))
    if 16 <= val <= 128:
        return True

OS filter — rejects anything containing windows; accepts Hebrew ללא מערכת הפעלה, FreeDOS, Linux, DOS, and No OS.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • ksp.co.il
    • Triggering command: /usr/bin/python python laptop_search.py (dns block)
  • www.ivory.co.il
    • Triggering command: /usr/bin/python python laptop_search.py (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Agent-Logs-Url: https://github.com/alonitac/DevOpsMay22/sessions/cf6e9b5f-8312-434f-a3a3-cffa32028ef3

Co-authored-by: DeniZaychenko <91252016+DeniZaychenko@users.noreply.github.com>
Copilot AI changed the title [WIP] Search for laptops without pre-installed OS Add laptop search script for IVORY and KSP (i5+, 16GB+, 512GB+, ≤3000₪, no-OS) Mar 29, 2026
Copilot AI requested a review from DeniZaychenko March 29, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants