Bruuuuuuce / PKUAutoSubmit

PKU一键出入校备案小工具
Apache License 2.0
177 stars 272 forks source link

找不到属性 'PhantomJS' #35

Open zfthys opened 2 years ago

zfthys commented 2 years ago

运行run.bat,报错信息如下: C:\Users\hhhh\Downloads\PKUAutoSubmit-main>python main.py 环境检查通过 Traceback (most recent call last): File "C:\Users\hhhh\Downloads\PKUAutoSubmit-main\main.py", line 44, in driver_pjs = webdriver.PhantomJS(executable_path=sys_path(browser="phantomjs")) AttributeError: module 'selenium.webdriver' has no attribute 'PhantomJS'

操作系统:win10 Python版本:3.10 selenium已更新到最新版本

SakuraLaurel commented 2 years ago

selenium最新版本不能运行,改成3.8.0版的即可。 pip install selenium==3.8.0

另外见#28 webdriver的参数需要注意。main.py文件中,主程序下这一句

driver_pjs = webdriver.PhantomJS(
        executable_path=sys_path(),
        service_args=['--ignore-ssl-errors=true', '--ssl-protocol=TLSv1'])

中的参数'--ssl-protocol=TLSv1'会使登录失败。仓库代码没这个问题,但发行版有。下载Release版的各位请删除此参数。

w1nda commented 2 years ago

附议。 新版本的selenium已经弃用PhantomJS:https://groups.google.com/g/phantomjs/c/9aI5d-LDuNE 可以卸载新版本,安装旧版本,亲测2.48.0也好用。

pip3 uninstall selenium && pip3 install -U selenium==2.48.0