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

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

本站已经建立2718天!

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