python3下安装Selenium插件和驱动

import sys
import os
import shutil
import time

os.system('pip install selenium')


file_name="IEDriverServer.exe"

#获取路径
python_path=os.path.dirname(sys.executable)
system_path=os.environ['WINDIR']+'\\system32'

#安装IEDriverServer
Desc_py_path=python_path+"\\"+file_name
Desc_sys_path=system_path+"\\"+file_name

shutil.copyfile(file_name,Desc_py_path)
shutil.copyfile(file_name,Desc_sys_path)
print("Selenium插件和驱动已经安装完成!!!")

猜你喜欢

转载自www.cnblogs.com/dengpeiyou/p/9248477.html