Skip to content

Commit cd88ac2

Browse files
PHY041claude
andcommitted
Initial release: SuperScrape v0.1.0
Web scraping + AI visual intelligence using Camoufox anti-detection browser. Features: - Amazon, Instagram, Reddit, eBay, Walmart, Etsy, Shopee scrapers - GPT Vision image analysis pipeline - Visual intelligence reports (Markdown + JSON + HTML + PDF) - FastAPI server with SSE job tracking - Next.js frontend - Docker deployment - GitHub Actions CI (Ruff + pytest + mypy) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0 parents  commit cd88ac2

75 files changed

Lines changed: 11576 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.dockerignore‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
venv/
2+
.venv/
3+
__pycache__/
4+
*.pyc
5+
.git/
6+
.env
7+
.env.example
8+
frontend/
9+
nginx/
10+
docker-compose.yml
11+
todbiccz_*
12+
visual_report_*
13+
tests/
14+
examples/

‎.env.example‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Required: OpenAI API key for GPT Vision analysis
2+
OPENAI_API_KEY=sk-proj-...
3+
4+
# Optional: BytePlus API key for Seedream lifestyle images
5+
BYTEPLUSES_API_KEY=

‎.github/workflows/ci.yml‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-python@v5
15+
with:
16+
python-version: "3.12"
17+
- run: pip install ruff
18+
- run: ruff check .
19+
- run: ruff format --check .
20+
21+
typecheck:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: actions/setup-python@v5
26+
with:
27+
python-version: "3.12"
28+
- run: pip install -e ".[dev]"
29+
- run: mypy superscrape/ --ignore-missing-imports
30+
continue-on-error: true
31+
32+
test:
33+
runs-on: ubuntu-latest
34+
strategy:
35+
matrix:
36+
python-version: ["3.10", "3.11", "3.12"]
37+
steps:
38+
- uses: actions/checkout@v4
39+
- uses: actions/setup-python@v5
40+
with:
41+
python-version: ${{ matrix.python-version }}
42+
- run: pip install -e ".[dev]"
43+
- run: pytest tests/ -x --tb=short

‎.gitignore‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*.egg-info/
5+
dist/
6+
build/
7+
.eggs/
8+
*.egg
9+
.venv/
10+
venv/
11+
12+
# Generated outputs
13+
visual_report_*
14+
todbiccz_*
15+
16+
# Client project data
17+
projects/
18+
19+
# Secrets
20+
.env
21+
.env.local
22+
23+
# Node
24+
node_modules/
25+
.next/
26+
27+
# IDE
28+
.idea/
29+
.vscode/
30+
*.swp
31+
*.swo
32+
33+
# OS
34+
.DS_Store
35+
Thumbs.db
36+
37+
# Testing / Coverage
38+
.pytest_cache/
39+
htmlcov/
40+
.coverage
41+
*.log
42+
.mypy_cache/
43+
44+
# Git backup
45+
.git_backup/

‎CONTRIBUTING.md‎

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Contributing to SuperScrape
2+
3+
Thanks for your interest in contributing! Here's how to get started.
4+
5+
## Development Setup
6+
7+
```bash
8+
# Clone the repo
9+
git clone https://github.com/PHY041/superscrape.git
10+
cd superscrape
11+
12+
# Create a virtual environment
13+
python -m venv venv
14+
source venv/bin/activate
15+
16+
# Install in editable mode with dev dependencies
17+
pip install -e ".[dev]"
18+
19+
# Install the Camoufox browser binary
20+
python -c "from camoufox.sync_api import Camoufox; print('ready')"
21+
```
22+
23+
## Code Style
24+
25+
We use [Ruff](https://docs.astral.sh/ruff/) for linting and formatting.
26+
27+
```bash
28+
# Lint
29+
ruff check .
30+
31+
# Format
32+
ruff format .
33+
34+
# Type check
35+
mypy superscrape/
36+
```
37+
38+
Before submitting a PR, make sure all checks pass:
39+
40+
```bash
41+
ruff check . && ruff format --check . && pytest tests/ -x
42+
```
43+
44+
## Running Tests
45+
46+
```bash
47+
# Unit tests (no API key or browser needed)
48+
pytest tests/ -x
49+
50+
# Verbose output
51+
pytest tests/ -xvs
52+
```
53+
54+
## Adding a New Platform Scraper
55+
56+
1. Create `superscrape/sites/your_platform.py`
57+
2. Inherit from `BaseScraper` in `superscrape/sites/base.py`
58+
3. Implement the required methods (see `amazon.py` as reference)
59+
4. Add a CLI command in `superscrape/cli/main.py`
60+
5. Add tests in `tests/test_your_platform.py`
61+
62+
## Pull Request Process
63+
64+
1. Fork the repo and create a feature branch
65+
2. Make your changes with tests
66+
3. Ensure `ruff check .` and `pytest tests/` pass
67+
4. Submit a PR with a clear description of changes
68+
69+
## Reporting Issues
70+
71+
Open an issue at https://github.com/PHY041/superscrape/issues with:
72+
- Steps to reproduce
73+
- Expected vs actual behavior
74+
- Python version and OS

‎Dockerfile‎

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
FROM python:3.12-slim
2+
3+
# System deps for Camoufox (headless Firefox) + WeasyPrint
4+
RUN apt-get update && apt-get install -y --no-install-recommends \
5+
xvfb \
6+
xauth \
7+
curl \
8+
fonts-noto-cjk \
9+
libglib2.0-0 \
10+
libnss3 \
11+
libnspr4 \
12+
libdbus-1-3 \
13+
libatk1.0-0 \
14+
libatk-bridge2.0-0 \
15+
libatspi2.0-0 \
16+
libdrm2 \
17+
libxcomposite1 \
18+
libxdamage1 \
19+
libxfixes3 \
20+
libxrandr2 \
21+
libgbm1 \
22+
libpango-1.0-0 \
23+
libcairo2 \
24+
libasound2 \
25+
libgtk-3-0 \
26+
&& rm -rf /var/lib/apt/lists/*
27+
28+
WORKDIR /app
29+
30+
COPY pyproject.toml README.md ./
31+
COPY superscrape/ superscrape/
32+
COPY api/ api/
33+
34+
# Install Python deps (non-editable for Docker)
35+
RUN pip install --no-cache-dir .
36+
37+
# Download Camoufox browser binary
38+
RUN python -c "from camoufox.sync_api import Camoufox; print('Camoufox binary ready')" || true
39+
40+
EXPOSE 8001
41+
42+
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
43+
CMD curl -f http://localhost:8001/health || exit 1
44+
45+
# xvfb-run provides virtual display for headless Camoufox
46+
CMD xvfb-run --auto-servernum --server-args="-screen 0 1280x720x24" \
47+
uvicorn api.main:app --host 0.0.0.0 --port 8001

‎LICENSE‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Haoyang Pang
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)