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

本站现有博文333篇,共被浏览929238

本站已经建立2637天!

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