Skip to content
This repository has been archived by the owner on Aug 23, 2020. It is now read-only.

webqq连手动登录都登不上去了 #319

Open
QingGo opened this issue May 4, 2018 · 4 comments
Open

webqq连手动登录都登不上去了 #319

QingGo opened this issue May 4, 2018 · 4 comments

Comments

@QingGo
Copy link

QingGo commented May 4, 2018

用用户名-密码自动登录的时候发现无法登录成功。
尝试手动登录,发现无论是用用户名密码还是扫码登录,登录以后只有一片灰屏的画面。
经过断点以后发现:
代码:
wait.until(EC.element_to_be_clickable((By.CLASS_NAME, 'face'))).click()
会抛出超时异常,虽然作者在源代码中直接用:
except: pass
直接忽略掉错误,但是可能是由于无法成功获得登录需要的cookies,从而还是会在在后续的
self.TestLogin()
无法成功登录,产生报错。

@yylzcom
Copy link

yylzcom commented May 4, 2018

我这里能扫码登录, 但是无论发送消息或者获取联系人列表都已经不行了, 结合我找不到SmartQQ官方使用界面来看, 怀疑是QQ彻底关闭了SmartQQ的接口
image

@QingGo
Copy link
Author

QingGo commented May 4, 2018

@yylzcom
今晚我这边qqbot又可以正常使用了,看来之前可能是SmartQQ一时大姨妈。

@yylzcom
Copy link

yylzcom commented May 4, 2018

@QingGo 所以现在SmartQQ的官方web界面是什么(如果官方web界面都没了api估计也活不了多久吧)

另外能不能详细分享一下headless的配置... 谢谢

@QingGo
Copy link
Author

QingGo commented May 4, 2018

@yylzcom
现在的官方web界面应该是http://web2.qq.com吧。
关于headless,比如我用的是firefox,首先保证selenium和firefox的版本都支持headless模式,然后在passwordlogin.py增加如下几行代码。

#from selenium.webdriver.chrome.options import Options
from selenium.webdriver.firefox.options import Options
...
def newLogin(self, conf):
        options = Options()
        options.add_argument("--headless")
        driver = getattr(webdriver, driverType)(firefox_options=options)
        #driver = getattr(webdriver, driverType)(chrome_options=options)

然后就可以使用headless模式了。
#317

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

No branches or pull requests

2 participants