class ClickAndSendKeys():
def test(self):
# Driverlocation
driverLocation = "C:/Users/Dennis.Pieruschka/Documents/chromedriver.exe"
os.environ["webdriver.chrome.driver"] = driverLocation
# Instantiate Chrome Browser Command
driver = webdriver.Chrome(driverLocation)
driver.maximize_window()
url = "http://www.visservanbaars.nl/vacatures"
driver.get(url)
driver.find_element_by_xpath("//div[@id='ajax-container']//form//div//input").click()
time.sleep(3)
driver.find_element_by_xpath("//div[@id='ajax-container']//form//div//input").send_keys("Bi Consultant")
time.sleep(3)
driver.find_element_by_xpath("//div[@id='ajax-container']//form//div/span/button").click()
ff = ClickAndSendKeys()
ff.test()
當我運行這段代碼,硒不進入下一個頁面鏈接不工作硒的webdriver(阿賈克斯容器)
XPath是正確的,但它點擊當它直接關閉窗口。
有誰知道如何使用它?
哪個環節OIS不能點擊 – iamsankalp89
我猜driver.find_element_by_xpath(「// DIV [@ ID = 'Ajax的容器'] //形式// div // input「)。click() 這會產生問題 – iamsankalp89