- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest2.py
More file actions
Latest commit
21 lines (17 loc) · 618 Bytes
/
Copy pathTest2.py
File metadata and controls
21 lines (17 loc) · 618 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
fromseleniumimportwebdriver
importos
importtime
fromselenium.webdriver.common.byimportBy
fromselenium.webdriver.common.keysimportKeys
fromselenium.webdriver.support.waitimportWebDriverWait
importselenium.webdriver.support.expected_conditionsasec
d2=webdriver.Firefox(executable_path=os.getcwd() +os.path.sep+"geckodriver_mac")
d2.maximize_window()
d2.get("https://www.google.com")
wait=WebDriverWait(d2, 30)
wait.until(ec.element_to_be_clickable((By.NAME, "q")))
element=d2.find_element_by_name("q")
element.send_keys("ramnath gokul")
element.send_keys(Keys.ENTER)
time.sleep(5)
d2.quit()