最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

環(huán)境配置

2023-06-09 17:11 作者:想吸萊萊  | 我要投稿

#!/usr/bin/env python

# coding: utf-8

import os;os.system('pip install requests')

try:

? ? import urllib3

? ? if urllib3.__version__ != "1.25.3":os.system('pip uninstall urllib3 -y');os.system('pip install urllib3==1.25.3')

except ModuleNotFoundError:os.system('pip install urllib3==1.25.3')

except ImportError:os.system('pip uninstall urllib3 -y');os.system('pip install urllib3==1.25.3')

os.system('pip install bs4');os.system('pip install lxml');requests = __import__("requests");bs = __import__("bs4").BeautifulSoup;import zipfile;import time;import sys;import re;import winreg

def xml_to_py(xmltext):

? ? soup = bs(xmltext, "lxml");contents_list = []

? ? for i in soup.find_all("contents"):

? ? ? ? item_dick = {}

? ? ? ? for j in i.children:

? ? ? ? ? ? item_dick[j.name] = j.text

? ? ? ? contents_list.append(item_dick)

? ? return contents_list

_v, type = winreg.QueryValueEx(winreg.OpenKey(winreg.HKEY_CURRENT_USER, r'Software\Google\Chrome\BLBeacon'), 'version');print("當(dāng)前版本號(hào):{}".format(_v));LATEST_RELEASE = _v;req = requests.get("http://chromedriver.storage.googleapis.com/LATEST_RELEASE_{}".format(LATEST_RELEASE.split(".")[0]));LATEST_RELEASE = req.text;print("可用版本號(hào):{}".format(req.text));req = requests.get("http://chromedriver.storage.googleapis.com/?delimiter=/&prefix={}/".format(req.text));contents_list = xml_to_py(req.text);This_LATEST_RELEASE = 0;flag = 0

for i in contents_list:

? ? if sys.platform == re.search(r"_.*", i['key']).group()[1:-4]:This_LATEST_RELEASE = flag;break;

? ? flag += 1

else:

? ? print("編號(hào)\t版本")

? ? for i in contents_list:print(f"{flag}\t{i['key']}");

? ? print("未找到當(dāng)前操作系統(tǒng)版本,請(qǐng)手動(dòng)選擇\n當(dāng)前操作系統(tǒng):{}".format(sys.platform));This_LATEST_RELEASE = int(input("請(qǐng)選擇下載版本編號(hào):"))

print("下載中");req = requests.get("http://chromedriver.storage.googleapis.com/{}".format(contents_list[This_LATEST_RELEASE]['key']));tempname = f"f{int(time.time())}.zip";print("下載成功,進(jìn)行解壓")

with open("{}".format(tempname), "wb")as f:f.write(req.content)

myzip = zipfile.ZipFile(f"{tempname}", "r")

if "chromedriver.exe" in myzip.namelist():myzip.extract("chromedriver.exe", "{}".format('/'.join(sys.executable.split('\\')[:-1])));print("已解壓至{}{}".format("{}".format('/'.join(sys.executable.split('\\')[:-1])),"chromedriver.exe"))

myzip.close();os.remove(tempname);os.system('pip install selenium==3.9.0')


環(huán)境配置的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
彰化县| 衡东县| 台州市| 洛南县| 贺州市| 扬州市| 嫩江县| 吴桥县| 三穗县| 柳河县| 色达县| 三都| 吉林市| 财经| 丰台区| 洪泽县| 万州区| 曲阜市| 信宜市| 罗田县| 徐闻县| 寿光市| 苗栗县| 陵川县| 温宿县| 建水县| 丹寨县| 政和县| 北安市| 高清| 武平县| 遵化市| 买车| 无棣县| 昌吉市| 松滋市| 中阳县| 厦门市| 静海县| 三台县| 大庆市|