Install
openclaw skills install pls-url-to-markdownFetch a URL and convert its web page content into clean Markdown for research, documentation, or knowledge base creation.
openclaw skills install pls-url-to-markdownFetches URLs and converts web pages to clean Markdown.
markdownify)pip install requests beautifulsoup4 markdownify
python3 -c "... fetching and converting URL ..."
html2text, pandoc)curl -s URL | html2text
wget -q -O - URL | pandoc -f html -t markdown
import requests
from bs4 import BeautifulSoup
from markdownify import markdownify as md
def url_to_markdown(url, output_file=None):
# ... fetch, parse, convert logic ...
pass
def extract_article(html):
soup = BeautifulSoup(html, 'html.parser')
article = soup.find('article') or soup.find('main')
return md(str(article)) if article else None
def preserve_code(html):
# ... logic to wrap code in ``` ...
pass
python url_to_markdown.py URL -o output.md
def safe_fetch(url, retries=3):
# ... retry logic ...
pass