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

本站现有博文321篇,共被浏览781947

本站已经建立2475天!

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