EADST

Obtain Links and Download Images from Webpages

Obtain Links and Download Images from Webpages

import requests
from bs4 import BeautifulSoup

def getHTMLText(url):
    try:
        res = requests.get(url, timeout = 6)
        res.raise_for_status()
        res.encoding = res.apparent_encoding
        return res.text
    except:
        return 'Error'

def main(url):
    demo = getHTMLText(url)
    soup = BeautifulSoup(demo, 'html.parser')
    a_labels = soup.find_all('a', attrs={'href': True})

    for idx, a in enumerate(a_labels):
        link = a.get('href')
        if "res" not in link and ".jpg" in link and idx % 50 == 1:
            urls = url + link
            save_path = "./save/" + link
            with open(save_path, 'wb') as f:
                f.write(requests.get(urls).content)


url = "http://eadst.com/"
main(url)
相关标签
About Me
XD
Goals determine what you are going to be.
Category
标签云
HuggingFace CSV API Claude Pandas 继承 Disk SPIE Hungarian Algorithm XGBoost SAM Transformers VGG-16 Anaconda Diagram 顶会 VSCode 多进程 Mixtral Pytorch COCO GPT4 签证 UI Cloudreve Vim Firewall SQLite logger CTC FP64 FP8 Jetson Attention News Tiktoken GoogLeNet YOLO Interview diffusers QWEN Website Conda tqdm Numpy OpenCV NameSilo Ptyhon Google Clash Permission Linux Docker 报税 CC CUDA 腾讯云 Shortcut Bert Template Llama NLTK git Qwen RGB GGML Augmentation LaTeX Tensor Hotel Search Safetensors transformers PDF Random 强化学习 OpenAI RAR Vmess Bin CEIR uwsgi 域名 OCR XML Qwen2.5 FlashAttention 图标 算法题 SQL ModelScope PIP SVR TTS Dataset ONNX printf Land Quantization TensorRT PyTorch Baidu uWSGI v2ray Bitcoin Zip git-lfs 关于博主 CAM Miniforge Excel GIT Datetime Domain LLM 论文速读 证件照 多线程 Paddle Pillow Crawler LLAMA 图形思考法 Sklearn scipy mmap Review WebCrawler Color Ubuntu Use Freesound Tracking DeepStream Quantize Plate NLP Pickle 净利润 TSV Rebuttal Python Video Nginx Paper MD5 BF16 版权 Animate Image2Text hf InvalidArgumentError 飞书 Hilton BeautifulSoup ChatGPT C++ WAN Streamlit 阿里云 Card torchinfo Distillation 第一性原理 Proxy PyCharm Statistics Magnet Jupyter v0.dev Git Translation FP16 Password tar llama.cpp Web LoRA Heatmap AI Breakpoint Windows 论文 BTC FastAPI VPN 音频 IndexTTS2 TensorFlow Markdown FP32 Agent Base64 icon Math GPTQ Bipartite CLAP EXCEL CV PDB 云服务器 公式 Michelin Food Logo DeepSeek Knowledge Input Django Gemma 递归学习法 Data Github LeetCode 搞笑 HaggingFace Plotly JSON Qwen2 UNIX 财报 ResNet-50
站点统计

本站现有博文327篇,共被浏览833323

本站已经建立2538天!

热门文章
文章归档
回到顶部