selenium+python初学者求教
fromseleniumimportwebdriverfromBaseScriptimport*fromselenium.webdriver.common.byimpor...
from selenium import webdriver
from BaseScript import *
from selenium.webdriver.common.by import By
class PageObject(Base):
kw_loc = (By.ID, "kw")
su_loc = "id, 'su'"
def __init__(self, driver):
self.driver = driver
self.driver.get("http://www.baidu.com")
def find_po_element(self, text):
print(self.kw_loc)
# self.find_element(self.kw_loc).clear()
self.find_element(self.kw_loc).send_keys(text)
# print(page_object)
driver = webdriver.Ie()
PageObject = PageObject(driver)
PageObject.find_po_element("abc")
为啥执行的时候浏览器总是崩溃呢,求大神解答 展开
from BaseScript import *
from selenium.webdriver.common.by import By
class PageObject(Base):
kw_loc = (By.ID, "kw")
su_loc = "id, 'su'"
def __init__(self, driver):
self.driver = driver
self.driver.get("http://www.baidu.com")
def find_po_element(self, text):
print(self.kw_loc)
# self.find_element(self.kw_loc).clear()
self.find_element(self.kw_loc).send_keys(text)
# print(page_object)
driver = webdriver.Ie()
PageObject = PageObject(driver)
PageObject.find_po_element("abc")
为啥执行的时候浏览器总是崩溃呢,求大神解答 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询