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

本站现有博文323篇,共被浏览795882

本站已经建立2493天!

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