无码av一区二区三区无码,在线观看老湿视频福利,日韩经典三级片,成 人色 网 站 欧美大片在线观看

歡迎光臨散文網(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ó)家法律
马鞍山市| 荆州市| 介休市| 晋中市| 景洪市| 平遥县| 布拖县| 陆川县| 习水县| 奉化市| 宜君县| 舒城县| 宜宾县| 永康市| 金溪县| 二连浩特市| 涟水县| 潜江市| 抚顺县| 抚顺市| 三门县| 阳春市| 兴化市| 巫溪县| 呼和浩特市| 丰都县| 黑龙江省| 攀枝花市| 玛纳斯县| 资兴市| 白水县| 望都县| 安徽省| 松阳县| 观塘区| 三门峡市| 元江| 随州市| 白城市| 康马县| 宁蒗|