Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python whatsapp上的selenium读取重定向_Python_Selenium_Selenium Webdriver_Webdriverwait - Fatal编程技术网

Python whatsapp上的selenium读取重定向

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

您好,我正在尝试编写一个函数来“等待”,直到用户实际扫描二维码,即如果用户登录,则返回True;如果用户未登录,则返回False。我在“网络”选项卡中检查了它是如何完成的,基本上这是一个到WhatsApp的帖子,然后用户登录

如果有别的办法,我洗耳恭听

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')))