Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

找不到属性 'PhantomJS' #35

Open
zfthys opened this issue Nov 12, 2021 · 2 comments
Open

找不到属性 'PhantomJS' #35

zfthys opened this issue Nov 12, 2021 · 2 comments

Comments

@zfthys
Copy link

zfthys commented Nov 12, 2021

运行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
Copy link

SakuraLaurel commented Nov 13, 2021

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
Copy link

w1nda commented Nov 15, 2021

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants