Skip to content

Conversation

@m4dm4rtig4n
Copy link
Contributor

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

  • New OctopusScraper class scraping HelloWatt comparison pages
  • HelloWatt HTML table parsing for pricing extraction
  • Fallback pricing data (December 2025) for both offer types
  • Updated price scraper registry and documentation

Test Plan

  • Scraper successfully extracts 34 offers from HelloWatt pages
  • Fallback data loads correctly when scraping fails
  • Offers validate against schema (name, type, prices, power levels)
  • Backend startup includes new provider in registry

…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]>
Copilot AI review requested due to automatic review settings December 5, 2025 08:07
@m4dm4rtig4n m4dm4rtig4n merged commit 77b307a into main Dec 5, 2025
5 checks passed
Copy link

Copilot AI left a 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 OctopusScraper class 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.

Comment on lines +361 to +362
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}")
Copy link

Copilot AI Dec 5, 2025

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).

Suggested change
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}")

Copilot uses AI. Check for mistakes.
- **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**
Copy link

Copilot AI Dec 5, 2025

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).

Suggested change
- **Total : ~254 offres énergétiques**
- **Total : ~270 offres énergétiques**

Copilot uses AI. Check for mistakes.
try:
val = float(price_match.group(1))
values.append(val)
except ValueError:
Copy link

Copilot AI Dec 5, 2025

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.

Suggested change
except ValueError:
except ValueError:
# Ignore malformed price values; skip and continue parsing other cells

Copilot uses AI. Check for mistakes.
@m4dm4rtig4n m4dm4rtig4n deleted the octopus-provider branch December 18, 2025 07:59
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