在whatsapp上的硒读取重定向

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

您好,我正在尝试编写一个“等待”功能,直到用户实际扫描QR码为止,即如果他已登录则返回True,否则返回False。我在“网络”标签中检查了此操作的完成情况,基本上这是对WhatsApp的POST,然后用户已登录。

如果还有另一种方法可以做到,那么我非常的高兴。

guoshuzhengsz 回答:在whatsapp上的硒读取重定向

WebDriverWait()expected_conditions.invisibility_of_element_located()一起使用:

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')))
本文链接:https://www.f2er.com/3150355.html

大家都在问