Facility: 001885

Rainbow Self Storage

Stale Data Warning: This facility has not been successfully scraped in 26 days (threshold: 3 days). Data may be outdated.
Facility Information active
Facility ID
001885
Name
Rainbow Self Storage
URL
https://rainbowstorage.com/
Address
105 Indianola Cutoff, Bayside, CA 95524, USA, Bayside, California 95524
Platform
custom_facility_001885
Parser File
src/parsers/custom/facility_001885_parser.py
Last Scraped
2026-03-27 13:39:27.908078
Created
2026-03-23 02:35:08.816820
Updated
2026-03-27 13:39:27.908078
Parser & Healing Diagnosis needs_fix
Parser Status
⚠ Needs Fix
Status Reason
Parser returned 0 units
Last Healing Attempt
Not attempted
Parser Source (src/parsers/custom/facility_001885_parser.py)
"""Parser for Rainbow Self Storage (StorEdge/Apollo platform)."""
from __future__ import annotations

import re

from bs4 import BeautifulSoup

from src.parsers.base import BaseParser, ParseResult, UnitResult


class Facility001885Parser(BaseParser):
    """Extract storage units from Rainbow Self Storage.

    Unit data is stored in the Apollo state JSON as UnitGroup entries with
    name (e.g. "10x25"), type (contains size/features), and price fields.

    Fallback: if no Apollo state is found, looks for JSON blobs in <pre>
    tags or visible text with size patterns.
    """

    platform = "custom_facility_001885"

    # Matches "UnitGroup:uuid": {"id":...,"name":"10x25","type":"...","price":175,...}
    _UNIT_GROUP_RE = re.compile(
        r'"UnitGroup:[^"]+":\{"id":"[^"]+","name":"([^"]+)","type":"([^"]*)","price":(\d+(?:\.\d+)?)'
    )

    # Matches visible "5ft x 8ft" style spans
    _SIZE_SPAN_RE = re.compile(r"(\d+)\s*ft\s*x\s*(\d+)\s*ft", re.IGNORECASE)
    _PRICE_RE = re.compile(r"\$(\d[\d,.]*)")

    def parse(self, html: str, url: str = "") -> ParseResult:
        result = ParseResult(platform=self.platform, parser_name=self.__class__.__name__)

        # Primary: Apollo state UnitGroup entries
        seen: set[tuple[str, float]] = set()
        for m in self._UNIT_GROUP_RE.finditer(html):
            name = m.group(1)       # e.g. "10x25"
            type_str = m.group(2)   # e.g. "10x15/SP(Eka/Broadway/DU)"
            price = float(m.group(3))

            # Normalize size from name (e.g. "10x25" -> "10x25")
            # Sometimes name uses actual display size (e.g. "5x20") but type may differ
            size_norm = re.sub(r"[^0-9x]", "", name.lower())
            if not re.match(r"^\d+x\d+$", size_norm):
                continue

            # Parse width/length
            parts = size_norm.split("x")
            width, length = int(parts[0]), int(parts[1])
            if width < 2 or length < 2:
                continue

            key = (size_norm, price)
            if key in seen:
                continue
            seen.add(key)

            unit = UnitResult()
            unit.size = f"{width}x{length}"
            unit.price = price
            # Infer features from type string
            features = []
            t = type_str.upper()
            if "DU" in t or "DRIVE" in t:
                features.append("Drive Up")
            elif "IN" in t or "INDOOR" in t or "AL" in t:
                features.append("Indoor")
            if "SP" in t or "SPECIAL" in t:
                features.append("Special")
            unit.description = type_str or unit.size
            w, ln, sq = self.normalize_size(unit.size)
            if w is not None:
                unit.metadata = {"width": w, "length": ln, "sqft": sq}
            result.units.append(unit)

        if result.units:
            return result

        # Fallback: visible DOM with <pre class="ng-binding"> JSON blobs
        soup = BeautifulSoup(html, "lxml")
        for table in soup.find_all("table", class_="results-wrap"):
            for tr in table.find_all("tr"):
                row_text = tr.get_text(separator=" ", strip=True)
                size_m = self._SIZE_SPAN_RE.search(row_text)
                price_m = self._PRICE_RE.search(row_text)
                if not size_m:
                    continue
                width_str = size_m.group(1)
                length_str = size_m.group(2)
                size_str = f"{width_str}x{length_str}"
                price_str = price_m.group(1) if price_m else ""
                key = (size_str, price_str)
                if key in seen:
                    continue
                seen.add(key)
                unit = UnitResult()
                unit.size = size_str
                if price_str:
                    unit.price = self.normalize_price(price_str)
                w, ln, sq = self.normalize_size(size_str)
                if w is not None:
                    unit.metadata = {"width": w, "length": ln, "sqft": sq}
                result.units.append(unit)

        if not result.units:
            result.warnings.append("No units found in Apollo state or DOM")
        return result

Scrape Runs (3)

Run #1517 Details

Status
exported
Parser Used
Facility001885Parser
Platform Detected
storageunitsoftware
Units Found
0
Stage Reached
exported
Timestamp
2026-03-27 13:39:24.923349
Timing
Stage Duration
Fetch2878ms
Detect24ms
Parse11ms
Export17ms

Snapshot: 001885_20260327T133927Z.html · Show Snapshot · Open in New Tab

No units found in this run.

All Failures for this Facility (3)

parse _WarningAsException scraper no_units_extracted warning Run #N/A | 2026-03-27 13:39:27.890473

No units extracted for 001885

Stack trace
src.reporting.failure_reporter._WarningAsException: No units extracted for 001885
parse _WarningAsException scraper no_units_extracted warning Run #N/A | 2026-03-27 13:39:26.102674

No units extracted for 001885

Stack trace
src.reporting.failure_reporter._WarningAsException: No units extracted for 001885
parse _WarningAsException scraper no_units_extracted warning Run #N/A | 2026-03-23 02:38:50.028442

No units extracted for 001885

Stack trace
src.reporting.failure_reporter._WarningAsException: No units extracted for 001885

← Back to dashboard