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

本站现有博文332篇,共被浏览885491

本站已经建立2590天!

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