Python Scripting & Automation

VerifiedCaution

Write and run Python scripts for data scraping, analysis, HTTP requests, and automation tasks. Pre-installed packages include requests, beautifulsoup4, lxml, and playwright.

Sby Skills Guide Bot
DevelopmentIntermediate
7/25/2026
Claude Code
#python#scripting#web-scraping#automation

Recommended for

Automated summary

Provides a Python 3 environment with pre-installed libraries for scripting, web scraping, file processing, HTTP requests, and browser automation.

Security analysis

Caution
Quality score90/100

This skill provides a Python execution environment with popular packages, enabling arbitrary code execution via Bash. While the provided patterns are legitimate and useful, it grants significant system access that could be misused by an agent, though the skill itself contains no malicious instructions.

No concerns found

How this analysis is made

Examples

Scrape static HTML with BeautifulSoup
Scrape https://example.com and print all paragraph texts using Python requests and BeautifulSoup.
Use Playwright for dynamic page
Use Python Playwright to open https://example.com, wait for network idle, and save the page title.
Process CSV from API response
Fetch JSON from https://api.example.com/data, convert to CSV, and write to /workspace/group/output.csv

name: python description: Write and run Python scripts for data scraping, analysis, file processing, HTTP requests, and automation tasks. Python 3 is pre-installed with requests, beautifulsoup4, lxml, and playwright. allowed-tools: Bash(python*:*)

Python Environment

Python 3 is available in this container with pre-installed packages.

Pre-installed packages

  • requests — HTTP client (GET, POST, APIs)
  • beautifulsoup4 + lxml — HTML/XML parsing & web scraping
  • playwright — Browser automation (shares system Chromium, no extra download)
  • json, csv, sqlite3, re, datetime — standard library

Usage patterns

Quick one-liner

python3 -c "import requests; r = requests.get('https://example.com'); print(r.status_code)"

Write and run script

cat > /tmp/scrape.py << 'EOF'
import requests
from bs4 import BeautifulSoup

resp = requests.get('https://example.com')
soup = BeautifulSoup(resp.text, 'lxml')
print(soup.title.string)
EOF
python3 /tmp/scrape.py

Web scraping with BeautifulSoup

import requests
from bs4 import BeautifulSoup

url = 'https://www.set.or.th/th/market/product/stock/quote/SET/price'
headers = {'User-Agent': 'Mozilla/5.0'}
resp = requests.get(url, headers=headers)
soup = BeautifulSoup(resp.text, 'lxml')

# Extract data from tables
for row in soup.select('table tr'):
    cells = [td.text.strip() for td in row.select('td')]
    if cells:
        print(cells)

Playwright browser automation (for JavaScript-rendered pages)

from playwright.sync_api import sync_playwright
import os

with sync_playwright() as p:
    browser = p.chromium.launch(
        executable_path=os.environ.get('PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH', '/usr/bin/chromium'),
        headless=True,
        args=['--no-sandbox', '--disable-gpu']
    )
    page = browser.new_page()
    page.goto('https://example.com')
    page.wait_for_load_state('networkidle')
    content = page.content()
    browser.close()

HTTP API calls

import requests
import json

# GET with JSON response
data = requests.get('https://api.example.com/data').json()

# POST with payload
resp = requests.post('https://api.example.com/submit',
    json={'key': 'value'},
    headers={'Authorization': 'Bearer TOKEN'}
)

CSV/JSON file processing

import csv
import json

# Read CSV
with open('data.csv') as f:
    reader = csv.DictReader(f)
    for row in reader:
        print(row)

# Write JSON
with open('output.json', 'w') as f:
    json.dump(data, f, ensure_ascii=False, indent=2)

Installing additional packages at runtime

If you need a package not pre-installed:

pip3 install --break-system-packages pandas numpy
python3 script.py

Note: Runtime-installed packages are lost when this container exits. Pre-installed packages persist across runs.

Important notes

  • Scripts should write output files to /workspace/group/ (persistent) not /tmp/ (lost on exit)
  • For Playwright: always use headless=True and --no-sandbox args
  • The system Chromium is shared between agent-browser and Playwright
  • Prefer requests + BeautifulSoup for static pages (faster, lighter)
  • Use Playwright only for JavaScript-heavy pages that need rendering

Browser Fallback Smoke Test

Use this when agent-browser is unavailable and you need to verify fallback quickly.

python3 - << 'PY'
from playwright.sync_api import sync_playwright
import os

with sync_playwright() as p:
    browser = p.chromium.launch(
        executable_path=os.environ.get('PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH', '/usr/bin/chromium'),
        headless=True,
        args=['--no-sandbox', '--disable-gpu'],
    )
    page = browser.new_page()
    page.goto('https://example.com', wait_until='domcontentloaded')
    print('title:', page.title())
    browser.close()
PY

If this succeeds, browser automation can continue via Python Playwright fallback.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/python-scripting-automation-mryiqh1r/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/python-scripting-automation-mryiqh1r' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/python-scripting-automation-mryiqh1r/download' --output '.skill-downloads/python-scripting-automation-mryiqh1r/SKILL.md.part' && mv '.skill-downloads/python-scripting-automation-mryiqh1r/SKILL.md.part' '.skill-downloads/python-scripting-automation-mryiqh1r/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Bash(python*:*)

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/python-scripting-automation-mryiqh1r/SKILL.md' && test -s '.skill-downloads/python-scripting-automation-mryiqh1r/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/python' && cp -R '.skill-downloads/python-scripting-automation-mryiqh1r' '.claude/skills/python'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/python-scripting-automation-mryiqh1r'

openskills read 'python-scripting-automation-mryiqh1r'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/python-scripting-automation-mryiqh1r/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills