Skip to content

Commit dd05a9c

Browse files
committed
ocs: add GitHub Pages site
1 parent fc87940 commit dd05a9c

20 files changed

Lines changed: 1268 additions & 1 deletion

.github/workflows/docs.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-python@v5
23+
with:
24+
python-version: "3.13"
25+
- name: Install docs dependencies
26+
run: python -m pip install -e ".[docs]"
27+
- name: Build docs
28+
run: mkdocs build --strict
29+
- uses: actions/configure-pages@v5
30+
- uses: actions/upload-pages-artifact@v3
31+
with:
32+
path: site
33+
deploy:
34+
needs: build
35+
runs-on: ubuntu-latest
36+
environment:
37+
name: github-pages
38+
url: ${{ steps.deployment.outputs.page_url }}
39+
steps:
40+
- id: deployment
41+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ __pycache__/
88
htmlcov/
99
dist/
1010
build/
11+
site/
1112
*.egg-info/
1213
.webskrap/
1314
test.py

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
WebSkrap does not include CAPTCHA solving, login-wall bypassing, credential bypassing, or access-control circumvention. Use it only on targets you are allowed to access.
1313

14+
Documentation: https://kacigaya.github.io/webskrap/
15+
1416
## Install
1517

1618
```bash

docs/api-reference.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# API Reference
2+
3+
::: webskrap.WebSkrapClient
4+
5+
::: webskrap.WebSkrapSession
6+
7+
::: webskrap.BrowserProfile
8+
9+
::: webskrap.SessionConfig
10+
11+
::: webskrap.StealthConfig
12+
13+
::: webskrap.ProxyConfig
14+
15+
::: webskrap.ResourcePolicy
16+
17+
::: webskrap.Viewport
18+
19+
::: webskrap.FetchResult
20+
21+
::: webskrap.get_profile
22+
23+
::: webskrap.list_profiles

docs/assets/webskrap-logo.png

586 KB
Loading

docs/development.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Development
2+
3+
Clone the repository:
4+
5+
```bash
6+
git clone https://github.com/kacigaya/webskrap.git
7+
cd webskrap
8+
```
9+
10+
Install development dependencies:
11+
12+
```bash
13+
pip install -e ".[dev,docs]"
14+
python -m playwright install chromium
15+
```
16+
17+
Run tests and lint:
18+
19+
```bash
20+
pytest -q
21+
ruff check .
22+
```
23+
24+
Preview docs locally:
25+
26+
```bash
27+
mkdocs serve
28+
```
29+
30+
Build docs:
31+
32+
```bash
33+
mkdocs build --strict
34+
```
35+
36+
## Publishing Docs
37+
38+
Docs are deployed by GitHub Actions from `main`.
39+
40+
Repository settings must use:
41+
42+
- Settings
43+
- Pages
44+
- Source: GitHub Actions
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Installation
2+
3+
Install WebSkrap from PyPI:
4+
5+
```bash
6+
pip install webskrap
7+
```
8+
9+
Install Playwright's Chromium browser:
10+
11+
```bash
12+
python -m playwright install chromium
13+
```
14+
15+
Verify the installation:
16+
17+
```bash
18+
webskrap doctor
19+
webskrap profiles
20+
```
21+
22+
## Development Install
23+
24+
For local development:
25+
26+
```bash
27+
git clone https://github.com/kacigaya/webskrap.git
28+
cd webskrap
29+
pip install -e ".[dev,docs]"
30+
python -m playwright install chromium
31+
```
32+
33+
Run checks:
34+
35+
```bash
36+
pytest -q
37+
ruff check .
38+
mkdocs build --strict
39+
```

docs/getting-started/quickstart.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Quickstart
2+
3+
## One-Shot Fetch
4+
5+
```python
6+
import asyncio
7+
8+
from webskrap import WebSkrapClient
9+
10+
11+
async def main() -> None:
12+
async with WebSkrapClient() as client:
13+
result = await client.fetch("https://example.com")
14+
print(result.status)
15+
print(result.final_url)
16+
print(result.title)
17+
print(result.text[:200])
18+
19+
20+
asyncio.run(main())
21+
```
22+
23+
## Keep A Headed Browser Open
24+
25+
Use a session when you want the browser to remain open for inspection.
26+
27+
```python
28+
import asyncio
29+
from pathlib import Path
30+
31+
from webskrap import SessionConfig, WebSkrapClient
32+
33+
34+
async def main() -> None:
35+
config = SessionConfig(
36+
headless=False,
37+
user_data_dir=Path(".webskrap/dev-session"),
38+
)
39+
40+
async with WebSkrapClient() as client:
41+
session = await client.session("dev", config=config)
42+
page = await session.context.new_page()
43+
await page.goto("https://example.com", wait_until="domcontentloaded")
44+
45+
input("Press Enter to close browser...")
46+
47+
48+
asyncio.run(main())
49+
```
50+
51+
## CLI Fetch
52+
53+
```bash
54+
webskrap fetch https://example.com
55+
webskrap fetch https://example.com --headed --screenshot example.png
56+
```

docs/index.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# WebSkrap
2+
3+
WebSkrap is an async-first Python scraping framework built on Playwright.
4+
5+
It provides coherent browser profiles, persistent browser sessions, resource routing, a CLI, and configurable browser hardening for data collection workflows that need realistic browser behavior.
6+
7+
!!! warning "Usage boundary"
8+
WebSkrap does not include CAPTCHA solving, login-wall bypassing, credential bypassing, or access-control circumvention. Use it only on targets you are allowed to access.
9+
10+
## Install
11+
12+
```bash
13+
pip install webskrap
14+
python -m playwright install chromium
15+
```
16+
17+
## First Fetch
18+
19+
```python
20+
import asyncio
21+
22+
from webskrap import WebSkrapClient
23+
24+
25+
async def main() -> None:
26+
async with WebSkrapClient() as client:
27+
result = await client.fetch("https://example.com")
28+
print(result.status)
29+
print(result.title)
30+
31+
32+
asyncio.run(main())
33+
```
34+
35+
## Features
36+
37+
- Async Playwright lifecycle management.
38+
- One-shot fetch helper for simple scripts.
39+
- Persistent sessions with browser storage.
40+
- Built-in desktop and mobile profiles.
41+
- Custom profile support for locale, timezone, viewport, headers, and browser surfaces.
42+
- Resource routing presets.
43+
- CLI commands for fetches, profile inspection, and environment checks.
44+
45+
## Next Steps
46+
47+
- [Installation](getting-started/installation.md)
48+
- [Quickstart](getting-started/quickstart.md)
49+
- [Sessions](user-guide/sessions.md)
50+
- [API Reference](api-reference.md)

docs/llm.txt

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# WebSkrap
2+
3+
WebSkrap is an async-first Python scraping framework built on Playwright.
4+
5+
Repository: https://github.com/kacigaya/webskrap
6+
Documentation: https://kacigaya.github.io/webskrap/
7+
Package: https://pypi.org/project/webskrap/
8+
9+
## Install
10+
11+
```bash
12+
pip install webskrap
13+
python -m playwright install chromium
14+
```
15+
16+
## Core API
17+
18+
- `WebSkrapClient`: async context manager for Playwright lifecycle.
19+
- `WebSkrapSession`: persistent browser context wrapper.
20+
- `SessionConfig`: browser launch and context settings.
21+
- `BrowserProfile`: coherent browser-visible profile settings.
22+
- `StealthConfig`: configurable browser hardening toggles.
23+
- `FetchResult`: structured result returned from fetches.
24+
25+
## Example
26+
27+
```python
28+
import asyncio
29+
30+
from webskrap import WebSkrapClient
31+
32+
33+
async def main() -> None:
34+
async with WebSkrapClient() as client:
35+
result = await client.fetch("https://example.com")
36+
print(result.status)
37+
print(result.title)
38+
39+
40+
asyncio.run(main())
41+
```
42+
43+
## Boundaries
44+
45+
WebSkrap does not include CAPTCHA solving, login-wall bypassing, credential bypassing, or access-control circumvention.
46+
47+
## Important Links
48+
49+
- Home: /
50+
- Installation: /getting-started/installation/
51+
- Quickstart: /getting-started/quickstart/
52+
- Client: /user-guide/client/
53+
- Sessions: /user-guide/sessions/
54+
- Profiles: /user-guide/profiles/
55+
- Stealth: /user-guide/stealth/
56+
- Resource Policy: /user-guide/resource-policy/
57+
- CLI: /user-guide/cli/
58+
- API Reference: /api-reference/

0 commit comments

Comments
 (0)