Open egg-west opened 5 years ago
Hi,
From this error, and your last error in the other issue, it seems that you've not logged in successfully. The two errors both indicate that the WeChat web interface did not load at all.
Just wanted to double confirm, did you scan the QR code with your phone when it appeared in the Terminal?
After you scan the QR code with WeChat on your phone, you will see something like the screenshot below, and you need to tap "Log In". After that (and waiting for 2-5 seconds depending on your network connection), wechit will load your chats automatically (or after you press ENTER, in case you're using the patch code I gave you in the other issue).
If you really already did the above and it's still not working, then it sounds really confusing and give me some time to think about what could possibly go wrong.
UPDATE:
My code is looking for these specific elements in the HTML.
Could you please add the following line right before it threw the error:
print driver.find_element_by_class_name("main").get_attribute("innerHTML")
And check if the elements I circled in the screenshot are there? Or if it's more convenient for you just dump the output here and l can take a look (but your friends names will also be in the HTML, so better redact them when copy-pasting!)
Thanks.
python 2.7.15 macOS 10.15.1 chrome : 版本 79.0.3945.88(正式版本) (64 位) ChromeDriver 79.0.3945.36 Happened when I scanned the QR and press a key. Please help. @LingDong-
press a key after scanning...
Traceback (most recent call last):
File "wechit.py", line 495, in <module>
main()
File "wechit.py", line 448, in main
print("logged in as \""+get_username(driver)+"\"! loading chats...")
File "wechit.py", line 294, in get_username
driver.find_element_by_class_name("give_me").find_element_by_class_name("display_name").get_attribute("innerHTML")
File "/Users/zhaoxuyan/anaconda/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 564, in find_element_by_class_name
return self.find_element(by=By.CLASS_NAME, value=name)
File "/Users/zhaoxuyan/anaconda/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 978, in find_element
'value': value})['value']
File "/Users/zhaoxuyan/anaconda/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/Users/zhaoxuyan/anaconda/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":".give_me"}
(Session info: headless chrome=79.0.3945.88)
Same issue here.
OS: Debian 10 buster
chrome: 79
python: 3.77
Traceback (most recent call last):
File "wechit.py", line 488, in
This Error is probably sensitive to the version of chrome or the platform.
Happened when I scanned the QR and press a key.