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

本站现有博文340篇,共被浏览1031265次

本站已经建立2722天!

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