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

本站现有博文329篇,共被浏览858814

本站已经建立2567天!

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