Facility: 003045

Santa Maria 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
003045
Name
Santa Maria Self Storage
URL
http://www.santamariaselfstorage.com/
Address
1100 Tama Ln, Santa Maria, CA 93455, USA, Santa Maria, California 93455
Platform
custom_facility_003045
Parser File
src/parsers/custom/facility_003045_parser.py
Last Scraped
2026-03-27 13:55:17.024617
Created
2026-03-14 16:21:53.706708
Updated
2026-03-27 13:55:17.055886
Parser & Healing Diagnosis working
Parser Status
✓ Working
Status Reason
N/A
Last Healing Attempt
Not attempted
Parser Source (src/parsers/custom/facility_003045_parser.py)
"""Parser for Santa Maria Self Storage."""

from __future__ import annotations

import re

from bs4 import BeautifulSoup

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


class Facility003045Parser(BaseParser):
    """Extract storage units from Santa Maria Self Storage."""

    platform = "custom_facility_003045"

    _UNIT_RE = re.compile(
        r"(\d+\s*[\'\'\u2032]?\s*[xX\u00d7]\s*\d+\s*[\'\'\u2032]?)"
        r"[^\$]{0,120}"
        r"\$(\d[\d,.]*)",
        re.DOTALL,
    )

    _PRICE_SIZE_RE = re.compile(
        r"\$(\d[\d,.]*)"
        r".{0,120}"
        r"(\d+\s*[\'\'\u2032]?\s*[xX\u00d7]\s*\d+\s*[\'\'\u2032]?)",
        re.DOTALL,
    )

    _SIZE_ONLY_RE = re.compile(
        r"(\d+\s*[\'\'\u2032]?\s*[xX\u00d7]\s*\d+\s*[\'\'\u2032]?)"
    )

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

        for tag in soup.find_all(["script", "style"]):
            tag.decompose()

        body_text = soup.get_text(separator="\n")

        seen: set[tuple[str, str]] = set()

        # Try size-then-price pattern
        for m in self._UNIT_RE.finditer(body_text):
            size_text = m.group(1).strip()
            price_text = m.group(2).strip()
            key = (size_text, price_text)
            if key in seen:
                continue
            seen.add(key)

            unit = UnitResult()
            unit.size = size_text
            w, ln, sq = self.normalize_size(size_text)
            if w is not None:
                unit.metadata = {"width": w, "length": ln, "sqft": sq}
            unit.price = self.normalize_price(price_text)
            unit.description = m.group(0).strip()[:200]
            if unit.size or unit.price:
                result.units.append(unit)

        # Try price-then-size pattern if no results
        if not result.units:
            for m in self._PRICE_SIZE_RE.finditer(body_text):
                price_text = m.group(1).strip()
                size_text = m.group(2).strip()
                key = (size_text, price_text)
                if key in seen:
                    continue
                seen.add(key)

                unit = UnitResult()
                unit.size = size_text
                w, ln, sq = self.normalize_size(size_text)
                if w is not None:
                    unit.metadata = {"width": w, "length": ln, "sqft": sq}
                unit.price = self.normalize_price(price_text)
                unit.description = m.group(0).strip()[:200]
                if unit.size or unit.price:
                    result.units.append(unit)

        # Fallback: extract sizes without prices
        if not result.units:
            seen_sizes: set[str] = set()
            for m in self._SIZE_ONLY_RE.finditer(body_text):
                size_text = m.group(1).strip()
                if size_text in seen_sizes:
                    continue
                w, ln, sq = self.normalize_size(size_text)
                if w is None or w < 3 or ln < 3:
                    continue
                seen_sizes.add(size_text)
                unit = UnitResult()
                unit.size = size_text
                unit.metadata = {"width": w, "length": ln, "sqft": sq}
                result.units.append(unit)

        if not result.units:
            result.warnings.append("No units found via regex")

        return result

Scrape Runs (5)

Run #1900 Details

Status
exported
Parser Used
Facility003045Parser
Platform Detected
table_layout
Units Found
24
Stage Reached
exported
Timestamp
2026-03-27 13:55:13.688766
Timing
Stage Duration
Fetch3236ms
Detect15ms
Parse7ms
Export21ms

Snapshot: 003045_20260327T135516Z.html · Show Snapshot · Open in New Tab

Parsed Units (24)

4x8

$60.00/mo

4x14

$70.00/mo

4x17

$85.00/mo

8x9

$95.00/mo

9x14

$150.00/mo

9x17

$195.00/mo

9x24

$205.00/mo

10x15

$190.00/mo

10x20

$215.00/mo

10x25

$240.00/mo

10x30

$250.00/mo

10x50

$260.00/mo

4x9

$55.00/mo

5x10

$70.00/mo

5x13

$85.00/mo

5x14

$90.00/mo

9x11

$110.00/mo

9x17

$165.00/mo

10x12

$140.00/mo

10x15

$155.00/mo

10x20

$160.00/mo

12x12

$155.00/mo

12x19

$210.00/mo

20x11

$250.00/mo

← Back to dashboard