-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from aleksandr-kotlyar/python-docs-and-exampl…
…es-03-2023 DOCS: actualize examples for selenium 4 on python
- Loading branch information
Showing
4 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import time | ||
|
||
from selenium import webdriver | ||
from selenium.webdriver.chrome import service | ||
|
||
from selenium.webdriver.common.by import By | ||
|
||
webdriver_service = service.Service("path/to/operadriver") | ||
webdriver_service.start() | ||
|
||
options = webdriver.ChromeOptions() | ||
options.binary_location = "path/to/operabrowser" | ||
options.add_experimental_option('w3c', True) | ||
|
||
driver = webdriver.Remote(webdriver_service.service_url, options=options) | ||
|
||
driver.get('https://www.google.com/') | ||
input_txt = driver.find_element(By.NAME, 'q') | ||
input_txt.send_keys('operadriver\n') | ||
|
||
time.sleep(5) # see the result | ||
driver.quit() |