momochuhu 发表于 2015-8-10 13:34:44

python编写selenium脚本,导入了SwitchTo但是在运行时报错

python编写selenium脚本,导入了SwitchTo但是在运行时报错:TypeError: 'SwitchTo' object is not callable

代码如下:
from selenium import selenium
from selenium import webdriver
import time
from selenium.webdriver.remote.webelement import WebElement
from selenium.webdriver.remote.webdriver import SwitchTo

......

driver.switch_to()
writeMail = driver.find_element_by_css_selector("li")
writeMail.click()
time.sleep(6)
页: [1]
查看完整版本: python编写selenium脚本,导入了SwitchTo但是在运行时报错