首页 > 解决方案 > Selenium 错误 - 它没有输入我的名字

问题描述

这是我第一次使用 python,我遇到了一些问题。我想自动化 webex(自动加入会议),但我无法通过此页面:https ://i.stack.imgur.com/kuaLI.png (它没有输入我的名字)并且我收到此错误:https: //i.stack.imgur.com/yPeon.png

以下是我遇到的问题:

错误代码

不输入框我也告诉它

这是我到目前为止所写的:

import pytest
import time
import json
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.chrome.service import Service


service = Service(r"chromedriver.exe")
service.start()
driver = webdriver.Remote(service.service_url)
driver.get('https://meetingsemea39.webex.com/meet/pr1812997966');
driver.find_element(By.ID, "push_download_join_by_browser").click()
time.sleep (6)
driver.find_element(By.CSS_SELECTOR, ".style-name-input-19PlX > .style-input-2nuAk").click()
time.sleep (3)
driver.find_element(By.CSS_SELECTOR, ".style-name-input-19PlX > .style-input-2nuAk").send_keys("Thanashs Ntouvlis")
driver.find_element(By.ID, "guest_next-btn").click()
driver.find_element(By.CSS_SELECTOR, ".style-audio-case-3xwDo").click()
driver.find_element(By.ID, "interstitial_join_btn").click()   

我无法找到如何为您提供页面源代码,但这是网址(https://meetingsemea39.webex.com/meet/pr1812997966)。只需从浏览器中按加入,您将在同一页面上。

您试图通过 CSS_SELECTOR 查找元素,但 style-input-2nuAk 是一个类,而不是 CSS 元素。按类名查找元素: driver.find_element_by_class_name("class_name")

它仍然没有在框中输入

标签: pythonseleniumwebex

解决方案


您试图通过 CSS_SELECTOR 查找元素,但style-input-2nuAk它是一个类,而不是 CSS 元素。

按类名查找元素:

driver.find_element_by_class_name("class_name")

推荐阅读