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

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

本站已经建立2452天!

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