Python whatsapp上的selenium读取重定向
您好,我正在尝试编写一个函数来“等待”,直到用户实际扫描二维码,即如果用户登录,则返回True;如果用户未登录,则返回False。我在“网络”选项卡中检查了它是如何完成的,基本上这是一个到WhatsApp的帖子,然后用户登录 如果有别的办法,我洗耳恭听 将Python whatsapp上的selenium读取重定向,python,selenium,selenium-webdriver,webdriverwait,Python,Selenium,Selenium Webdriver,Webdriverwait,您好,我正在尝试编写一个函数来“等待”,直到用户实际扫描二维码,即如果用户登录,则返回True;如果用户未登录,则返回False。我在“网络”选项卡中检查了它是如何完成的,基本上这是一个到WhatsApp的帖子,然后用户登录 如果有别的办法,我洗耳恭听 将WebDriverWait()与预期的\u条件一起使用。所定位的\u元素的不可见性(): from selenium import webdriver from selenium.common.exceptions import NoSuchE
WebDriverWait()
与预期的\u条件一起使用。所定位的\u元素的不可见性()
:
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox(executable_path='/home/geckodriver')
driver.get('https://web.whatsapp.com/')
#function to check weather qr code is scanned or not
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait
WebDriverWait(driver, 60).until(EC.invisibility_of_element_located((By.CLASS_NAME, 'landing-window')))