Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

CentOS7 登录不了 #17

Closed
mS0gxokXEsg5ysJ7J79kzWiqO1fHgFA6ZR8eEls opened this issue Aug 11, 2017 · 12 comments
Closed

CentOS7 登录不了 #17

mS0gxokXEsg5ysJ7J79kzWiqO1fHgFA6ZR8eEls opened this issue Aug 11, 2017 · 12 comments

Comments

@mS0gxokXEsg5ysJ7J79kzWiqO1fHgFA6ZR8eEls

Commit Id:
问题描述: 登录不了 密码都正确的
操作系统版本: CentOS7
Python版本: 2.7.13

复现步骤:
[root@localhost Qzone_Photo]# python main.py
2017-08-11 15:24:56,859 - INFO - Logger初始化完成
2017-08-11 15:24:56,861 - INFO - 读取配置文件
2017-08-11 15:24:56,862 - INFO - 读取配置文件完成
2017-08-11 15:24:56,863 - INFO - 登陆QQ:
Traceback (most recent call last):
File "main.py", line 31, in
qz.login(config['account'], config['password'])
File "/root/Qzone_Photo/qphoto/init.py", line 52, in login
request.login()
File "/usr/local/python2.7.13/lib/python2.7/site-packages/qqlib/init.py", line 193, in login
raise LogInError(r[4])
qqlib.LogInError: <exception str() failed>

@mS0gxokXEsg5ysJ7J79kzWiqO1fHgFA6ZR8eEls

Windows 10 也是这个错误,不管登录哪个QQ都是这个错误

C:\Users\user\Desktop\Qzone_Photo-master>Python main.py
2017-08-11 15:47:22,660 - INFO - Logger初始化完成
2017-08-11 15:47:22,661 - INFO - 读取配置文件
2017-08-11 15:47:22,661 - INFO - 读取配置文件完成
2017-08-11 15:47:22,661 - INFO - 登陆QQ:
Traceback (most recent call last):
File "main.py", line 31, in
qz.login(config['account'], config['password'])
File "C:\Users\user\Desktop\Qzone_Photo-master\qphoto_init_.py", line 52, in login
request.login()
File "C:\Python27\lib\site-packages\qqlib_init_.py", line 193, in login
raise LogInError(r[4])
qqlib.LogInError: <exception str() failed>

@tianjyan
Copy link
Owner

转到 gera2ld/qqlib#23

@mS0gxokXEsg5ysJ7J79kzWiqO1fHgFA6ZR8eEls

能具体一点嘛 新手不是很懂

@tianjyan
Copy link
Owner

QQ改了登录方式

@mS0gxokXEsg5ysJ7J79kzWiqO1fHgFA6ZR8eEls

那应该怎么办呢, 我用selenium模拟登陆弄到了qzone的cookie,然后我应该怎么调用这个cookie呢?

@mS0gxokXEsg5ysJ7J79kzWiqO1fHgFA6ZR8eEls
    driver.switch_to.frame("login_frame")
    driver.find_element_by_id("switcher_plogin").click()
    driver.find_element_by_id("u").clear()
    driver.find_element_by_id("u").send_keys("QQ号码")
    driver.find_element_by_id("p").clear()
    driver.find_element_by_id("p").send_keys("QQ密码")
    driver.find_element_by_id("login_button").click()
    time.sleep(5)
    print "ok"

我看到网上用这种代码就很容易登录,希望大神能整合一下

@tianjyan
Copy link
Owner

我不想用这种Trick的方式,毕竟每次官方的UI变动都要更改代码。

@z589533
Copy link

z589533 commented Aug 24, 2017

能做兼容吗?现在一运行就报错

@tianjyan
Copy link
Owner

不兼容了,因为时间和精力有限,回头我会把这个Repo标记为Deprecated

@mS0gxokXEsg5ysJ7J79kzWiqO1fHgFA6ZR8eEls

嘿嘿 我在网上搜到一篇文章 https://www.zh30.com/python-selenium-qqzone-album.html

非常给力,原文作者只是写了获取列出所有相册照片地址的方法,似乎是偷懒了,没有一步到位保存到本地的代码,不过没事,我就是累一点手动操作下,也挺快的~~~~

手动全选Python输出的所有信息
丢进世界最好没有之一的神器EmEditor里面 全选 右键 排序 按文本长度从短到长排序
然后删除最前面非http://的字符串乱码等乱七八糟的东西

每行一张照片地址 保存到down.txt
丢到CentOS7的/root/qzone里
执行一下wget -c -i down.txt
就全部下载完毕了

哦 还忘了重命名 打包一下到本地 随便找个批量重命名软件
搞定之~~~~~~

@tianjyan
Copy link
Owner

蛮好的啊,你可以自己写一个repo 练手 @mS0gxokXEsg5ysJ7J79kzWiqO1fHgFA6ZR8eEls

@mS0gxokXEsg5ysJ7J79kzWiqO1fHgFA6ZR8eEls

@youngytj 哈哈 只是略懂一点皮毛而已 希望大神能参考下那个博主的代码打包一下再加个下载到本地的功能,顺便把chromedriver.exe也打包进Git吧这样对那些不懂的新手也比较方便

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

3 participants