编程技术分享平台

网站首页 > 技术教程 正文

Nginx下载脚本(当前稳定版本)(nginx安装脚本)

xnh888 2024-09-25 23:29:43 技术教程 14 ℃ 0 评论

#!/usr/bin/env python

# -*- coding: utf-8 -*-

import bs4

import requests

import os

url = 'http://nginx.org/en/download.html'

response = requests.get(url)

content = bs4.BeautifulSoup(response.content.decode("gbk"), "html.parser")

nginx_tar = content.find_all('a')

stable_version = nginx_tar[21]["href"]

nginx_url = 'http://nginx.org%s' % stable_version

os.system('wget %s' % nginx_url)

Tags:

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表