Python 如何使用Selenium登录WebEx平台

Python 如何使用Selenium登录WebEx平台,python,python-3.x,selenium,selenium-webdriver,selenium-chromedriver,Python,Python 3.x,Selenium,Selenium Webdriver,Selenium Chromedriver,我不能登录到WebEx平台,我需要能够登录到WebEx来抓取本周安排的会议。我不断得到回溯,但我甚至无法将.keys()方法发送到登录容器上的透视登录表单。最主要的是我对自动上网有意见。我需要能够登录,以便能够分析和查看当前的星期时间表 您可以在此处看到代码: 不起作用的代码是: #browser.switchTo.frame(“topframeset”) #浏览器.切换到.frame(“主”) #认证 #凭证需要单元测试 username=WebDriverWait(浏览器,延迟)。直到(EC

我不能登录到WebEx平台,我需要能够登录到WebEx来抓取本周安排的会议。我不断得到回溯,但我甚至无法
将.keys()
方法发送到登录容器上的透视登录表单。最主要的是我对自动上网有意见。我需要能够登录,以便能够分析和查看当前的星期时间表

您可以在此处看到代码:

不起作用的代码是:

#browser.switchTo.frame(“topframeset”)
#浏览器.切换到.frame(“主”)
#认证
#凭证需要单元测试
username=WebDriverWait(浏览器,延迟)。直到(EC.presence\u元素的位置((By.ID,'mwx ipt username'))
#utente=浏览器。通过id(“mwx ipt用户名”)查找元素。发送密钥('user@gestione.eu')
password=WebDriverWait(浏览器,延迟)。直到(EC.presence\u元素的位置((By.ID,'mwx ipt password'))
用户名。发送密钥(配置['user']['username'])
密码。发送密钥(配置['user']['password'])
#身份验证提交。单击()
#对于XPATH=/*[@id='mwx-btn-logon']
element=WebDriverWait(浏览器,20)。直到(
EC.element可点击((By.XPATH,“/*[@id='mwx-btn-logon']))
元素。单击();
打印(“登录Mirantis WebEx系统!”)
以下是页面来源:


米兰蒂斯公司WebEx企业网站
函数setCookie(名称、值)
{ 
风险值天数=30天;
var exp=新日期();
exp.setTime(exp.getTime()+天*24*60*60*1000);
document.cookie=name+“=”+escape(value)+“expires=“+exp.togmString()+”;path=/”;
} 
函数getCookie(名称)
{
变量搜索=名称+“=”;
如果(document.cookie.length>0)
{//如果有饼干的话
偏移量=document.cookie.indexOf(搜索);
如果(偏移量!=-1)
{//如果cookie存在
offset+=search.length;//设置值开头的索引
end=document.cookie.indexOf(“;”,offset);//设置cookie值末尾的索引
如果(结束==-1)
end=document.cookie.length;
返回unescape(document.cookie.substring(offset,end));
}
}
}
//默认页面不应加载到另一个框架内
if(top.location!=self.location){
top.location=self.location;
}
var One Day=1*24*60*60*1000;
var expDate=新日期();
expDate.setTime(expDate.getTime()+一天);
var cookieExpires=expDate.togmString();
document.cookie=“verifyCookie=test;expires=“+cookieExpires
if(document.cookie.length

元素存在于
iframe
name
mainFrame
中,您需要先切换它。 诱导
WebDriverWait
()和
frame\u可用,并切换到\u it
()和iframe name

此处代码:

from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC

browser=webdriver.Chrome("path here")
url = "https://mirantis.webex.com"
browser.get(url)
element = WebDriverWait(browser, 20).until(EC.element_to_be_clickable((By.XPATH, "//*[@id='guest_signin_button']")))
element.click();
WebDriverWait(browser,20).until(EC.frame_to_be_available_and_switch_to_it((By.NAME,"mainFrame")))
username = WebDriverWait(browser, 5).until(EC.element_to_be_clickable((By.ID, 'mwx-ipt-username')))
username.send_keys("user@abc.com")
password = WebDriverWait(browser, 5).until(EC.element_to_be_clickable((By.ID, 'mwx-ipt-password')))
password.send_keys("userabc")
浏览器快照:

from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC

browser=webdriver.Chrome("path here")
url = "https://mirantis.webex.com"
browser.get(url)
element = WebDriverWait(browser, 20).until(EC.element_to_be_clickable((By.XPATH, "//*[@id='guest_signin_button']")))
element.click();
WebDriverWait(browser,20).until(EC.frame_to_be_available_and_switch_to_it((By.NAME,"mainFrame")))
username = WebDriverWait(browser, 5).until(EC.element_to_be_clickable((By.ID, 'mwx-ipt-username')))
username.send_keys("user@abc.com")
password = WebDriverWait(browser, 5).until(EC.element_to_be_clickable((By.ID, 'mwx-ipt-password')))
password.send_keys("userabc")

元素存在于
iframe
name
mainFrame
中,您需要先切换它。 诱导
WebDriverWait
()和
frame\u可用,并切换到\u it
()和iframe name

此处代码:

from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC

browser=webdriver.Chrome("path here")
url = "https://mirantis.webex.com"
browser.get(url)
element = WebDriverWait(browser, 20).until(EC.element_to_be_clickable((By.XPATH, "//*[@id='guest_signin_button']")))
element.click();
WebDriverWait(browser,20).until(EC.frame_to_be_available_and_switch_to_it((By.NAME,"mainFrame")))
username = WebDriverWait(browser, 5).until(EC.element_to_be_clickable((By.ID, 'mwx-ipt-username')))
username.send_keys("user@abc.com")
password = WebDriverWait(browser, 5).until(EC.element_to_be_clickable((By.ID, 'mwx-ipt-password')))
password.send_keys("userabc")
浏览器快照:

from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC

browser=webdriver.Chrome("path here")
url = "https://mirantis.webex.com"
browser.get(url)
element = WebDriverWait(browser, 20).until(EC.element_to_be_clickable((By.XPATH, "//*[@id='guest_signin_button']")))
element.click();
WebDriverWait(browser,20).until(EC.frame_to_be_available_and_switch_to_it((By.NAME,"mainFrame")))
username = WebDriverWait(browser, 5).until(EC.element_to_be_clickable((By.ID, 'mwx-ipt-username')))
username.send_keys("user@abc.com")
password = WebDriverWait(browser, 5).until(EC.element_to_be_clickable((By.ID, 'mwx-ipt-password')))
password.send_keys("userabc")

非常感谢@KubduK这帮助了数百万人。非常感谢@KubduK这帮助了数百万人。