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

本站现有博文336篇,共被浏览946792

本站已经建立2657天!

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