HTML Downloader
Installation
# you can use a Conda environment
pip install --extra-index-url https://oauth2accesstoken:$(gcloud auth print-access-token)@glsdk.gdplabs.id/gen-ai-internal/simple/ "gllm-docproc[html]"# you can use a Conda environment
$token = (gcloud auth print-access-token)
pip install --extra-index-url "https://oauth2accesstoken:$token@glsdk.gdplabs.id/gen-ai-internal/simple/" "gllm-docproc[html]"# you can use a Conda environment
FOR /F "tokens=*" %T IN ('gcloud auth print-access-token') DO SET TOKEN=%T
pip install --extra-index-url "https://oauth2accesstoken:%TOKEN%@glsdk.gdplabs.id/gen-ai-internal/simple/" "gllm-docproc[html]"Basic Usage
1
from gllm_docproc.downloader.html import HTMLDownloader
source = "https://books.toscrape.com/"
output_path = "downloader/output/download"
# Initialize downloader
downloader = HTMLDownloader()
# Download input
downloader.download(source, output_path)2
python main.py3
Crawl URL
1
from gllm_docproc.downloader.html import HTMLDownloader
source = "https://quotes.toscrape.com/"
output_path = "downloader/output/crawl"
# Initialize the downloader and set the allowed domains
downloader = HTMLDownloader(allowed_domains=["quotes.toscrape.com"])
# Download input
downloader.download_crawl(source, output_path)2
python main.py3
Download from Sitemap
1
2
3
Last updated
Was this helpful?