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

本站现有博文338篇,共被浏览969436次

本站已经建立2681天!

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