Skip to content

feat(scrapers): replace ISS scraper with Nordrest scraper for Gourmed…#4

Open
simon-ingelsson-sr wants to merge 6 commits into
engdahl:mainfrom
simon-ingelsson-sr:ops
Open

feat(scrapers): replace ISS scraper with Nordrest scraper for Gourmed…#4
simon-ingelsson-sr wants to merge 6 commits into
engdahl:mainfrom
simon-ingelsson-sr:ops

Conversation

@simon-ingelsson-sr

@simon-ingelsson-sr simon-ingelsson-sr commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

…ia and Karavan

  • Add NordrestMenuScraper parsing the Castit lunch widget from nordrest.se
  • Support weekly specials (veckans rätt) merged into each day's menu
  • Switch Gourmedia and Karavan to use NordrestMenuScraper
  • Remove unused iss_scraper.py
  • Add 'salladsbar' as a vegetarian keyword in DishClassifier
  • Display menu items as bullet points in CLI output

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Test improvements
  • Refactoring (no functional changes)

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Testing

# Run tests locally
pytest tests/ -v

# Check coverage
pytest tests/ -v --cov=lunchscraper

Screenshots (if applicable)

Additional Context

simon-ingelsson-sr and others added 6 commits June 15, 2026 11:25
…ia and Karavan

- Add NordrestMenuScraper parsing the Castit lunch widget from nordrest.se
- Support weekly specials (veckans rätt) merged into each day's menu
- Switch Gourmedia and Karavan to use NordrestMenuScraper
- Remove unused iss_scraper.py
- Add 'salladsbar' as a vegetarian keyword in DishClassifier
- Display menu items as bullet points in CLI output

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…cture

Both Gourmedia and Karavan now render menus via the Castit widget
using 'section.castit-day' elements instead of the old accordion
structure ('div.accordion-item.weekday-item').

- Rewrite _parse_weekly_menu to find section.castit-day elements
  and extract dish titles/descriptions from castit-dish divs
- Add missing 'import re' that caused NameError in _parse_dishes
- Fix .mcp.json to point to simon-ingelsson-sr/rhlunch instead of
  hamiltoon/rhlunch (which still used the old ISS API scraper)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Extract dishes from the castit-week-specials-column section and
append them to every day's menu, so recurring weekly dishes like
'Karavans salladsbar' are included alongside the daily offerings.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
26 tests covering:
- _fetch_page (success + HTTP failure)
- _extract_dishes_from_section (title+desc, no desc, too-short skip)
- _parse_dishes (menu key, dietary codes, price suffix, empty, short)
- _parse_weekly_menu (all weekdays, weekly specials appended, no castit,
  unrecognised day names)
- get_menu_for_day (Monday, Tuesday, day not found, fetch failure)
- get_weekly_menu (all days, fetch failure)
- Integration tests against live-fetched HTML fixtures for both
  Karavan and Gourmedia (2025-11-10)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant