-
Notifications
You must be signed in to change notification settings - Fork 0
feat(scraper): add Octopus Energy provider #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ation Add new OctopusScraper that scrapes Eco-conso and Eco-saison tariffs from HelloWatt comparison pages. Generates 34 offers across 4 categories (BASE and HC/HP for each offer type). Includes fallback pricing data from December 2025. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds Octopus Energy France as a new energy provider with automatic price scraping capabilities. The implementation follows the established scraper pattern used by other providers, fetching pricing data from HelloWatt comparison pages for two Octopus offers: Eco-conso (fixed rates) and Eco-saison (seasonal rates with 20% discount April-October).
Key Changes
- New
OctopusScraperclass with HelloWatt HTML parsing for both Eco-conso and Eco-saison offers - Comprehensive fallback pricing data (December 2025) for all 34 offer combinations
- Integration into the price scraper registry and documentation updates
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| apps/api/src/services/price_scrapers/octopus_scraper.py | New scraper implementation with HTML table parsing, fallback data, and validation for 34 Octopus offers across BASE and HC/HP options |
| apps/api/src/services/price_scrapers/init.py | Added OctopusScraper to exports for registry integration |
| apps/api/src/services/price_update_service.py | Registered Octopus in scraper registry with website URL |
| docs/pages/admin-offers.md | Updated provider count from 8 to 9 and total offers from ~236 to ~254 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if offer.offer_type == "HC_HP" and (not offer.hp_price or not offer.hc_price): | ||
| self.logger.error(f"HC_HP offer missing prices: {offer.name}") |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The HC_HP validation should check if prices are greater than 0, not just if they exist. Currently this checks not offer.hp_price or not offer.hc_price but should check not offer.hp_price or offer.hp_price <= 0 or not offer.hc_price or offer.hc_price <= 0 to be consistent with BASE validation logic on line 357 and match the validation pattern used in other scrapers like EDF (line 698-700 in edf_scraper.py).
| if offer.offer_type == "HC_HP" and (not offer.hp_price or not offer.hc_price): | |
| self.logger.error(f"HC_HP offer missing prices: {offer.name}") | |
| if offer.offer_type == "HC_HP" and (not offer.hp_price or offer.hp_price <= 0 or not offer.hc_price or offer.hc_price <= 0): | |
| self.logger.error(f"HC_HP offer missing or invalid prices: {offer.name}") |
| - **Liste des 8 fournisseurs** : EDF, Enercoop, TotalEnergies, Priméo Énergie, Engie, ALPIQ, Alterna, Ekwateur | ||
| - **Total : ~236 offres énergétiques** | ||
| - **Liste des 9 fournisseurs** : EDF, Enercoop, TotalEnergies, Priméo Énergie, Engie, ALPIQ, Alterna, Ekwateur, Octopus | ||
| - **Total : ~254 offres énergétiques** |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The total offer count appears incorrect. The PR adds 34 Octopus offers (9 BASE + 8 HC/HP for Eco-conso, plus 9 BASE + 8 HC/HP for Eco-saison = 34 total), but the documentation shows an increase from ~236 to ~254 (only +18 offers). The correct total should be ~270 offers (~236 + 34 = ~270).
| - **Total : ~254 offres énergétiques** | |
| - **Total : ~270 offres énergétiques** |
| try: | ||
| val = float(price_match.group(1)) | ||
| values.append(val) | ||
| except ValueError: |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'except' clause does nothing but pass and there is no explanatory comment.
| except ValueError: | |
| except ValueError: | |
| # Ignore malformed price values; skip and continue parsing other cells |
Summary
Add Octopus Energy France as a new energy provider with automatic price scraping from HelloWatt comparison pages. The scraper fetches both Eco-conso (fixed rates) and Eco-saison (seasonal rates, 20% cheaper April-October) tariffs, generating 34 total offers across BASE and HC/HP pricing options.
Changes
OctopusScraperclass scraping HelloWatt comparison pagesTest Plan