Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to import the Selenium WebDriver module.
Selenium Python
from selenium import [1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'driver' instead of 'webdriver' causes import errors.
Trying to import 'selenium' directly does not give access to WebDriver.
✗ Incorrect
The correct import to use Selenium WebDriver is webdriver. This module allows controlling browsers.
2fill in blank
mediumComplete the command to install Selenium using pip.
Selenium Python
pip [1] selenium Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'pip remove selenium' will try to uninstall Selenium.
Using 'pip update selenium' is not a valid pip command.
✗ Incorrect
The command to add Selenium to your Python environment is pip install selenium.
3fill in blank
hardFix the error in the import statement to use Selenium WebDriver.
Selenium Python
import selenium.[1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'selenium.driver' causes module not found errors.
Trying to import 'selenium.selenium' is invalid.
✗ Incorrect
The correct submodule to import from Selenium is webdriver, not 'browser' or 'driver'.
4fill in blank
hardFill both blanks to complete the pip command to upgrade Selenium.
Selenium Python
pip [1] --[2] selenium
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'pip upgrade selenium' alone is invalid.
Using '--force' is not the standard option to upgrade.
✗ Incorrect
To upgrade Selenium, use pip install --upgrade selenium.
5fill in blank
hardFill all three blanks to write a Python code snippet that opens Chrome using Selenium.
Selenium Python
from selenium import [1] browser = [2].[3]()
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'browser.Chrome()' causes errors because 'browser' is not imported.
Importing 'driver' instead of 'webdriver' causes import errors.
✗ Incorrect
You import webdriver from Selenium, then create a webdriver.Chrome() instance to open Chrome.