Here is a simple way, platform independent:
Code:
driver.execute_script("window.open('http://google.com', 'new_window')")
Switching back to the original tab:
Code:
driver.switch_to_window(driver.window_handles[0])
Checking the current title to be sure you are on the right page:
Code:
driver.title
For everything else, have fun!
More Related Contents:
- How to open a Chrome Profile through Python
- WebDriverException: Message: ‘chromedriver’ executable needs to be in PATH while setting UserAgent through Selenium Chromedriver python
- How to make Selenium not wait till full page load, which has a slow script?
- How to use Chrome Profile in Selenium Webdriver Python 3
- WebDriverException: unknown error: cannot find Chrome binary error with Selenium in Python for older versions of Google Chrome
- USB: usb_device_handle_win.cc:1020 Failed to read descriptor from node connection error with ChromeDriver v87 / Chrome v87 using Selenium on Windows10
- Change ChromeOptions in an existing webdriver
- Running Selenium WebDriver python bindings in chrome
- WebDriverException: Message: Service chromedriver unexpectedly exited. Status code was: 127
- InvalidArgumentException: Message: invalid argument: user data directory is already in use error using –user-data-dir to start Chrome using Selenium
- Error Message: ‘chromedriver’ executable needs to be PATH
- selenium.common.exceptions.WebDriverException: Message: invalid session id using Selenium with ChromeDriver and Chrome through Python
- How to set window size in Selenium Chrome Python
- Downloading with chrome headless and selenium
- Download file through Google Chrome in headless mode
- Failed to read descriptor from node connection: A device attached to the system is not functioning error using ChromeDriver Selenium on Windows OS
- WebDriverException: Message: Service /usr/lib/chromium-browser/chromedriver unexpectedly exited on Raspberry-Pi with ChromeDriver and Selenium
- Downloading a file at a specified location through python and selenium using Chrome driver
- urllib3.exceptions.ProtocolError: (‘Connection aborted.’, error(10054, ‘An existing connection was forcibly closed by the remote host’))
- Set chrome browser binary through chromedriver in Python
- DeprecationWarning: use options instead of chrome_options error using ChromeDriver and Chrome through Selenium on Windows 10 system
- WebDriverException: Message: Service /content/chromedriver unexpectedly exited. Status code was: -6 with ChromeDriver Google Colab and Selenium
- TypeError: ‘module’ object is not callable error with driver=webdriver(“C:\\Python34\\Lib\\site-packages\\selenium\\webdriver\\chromedriver.exe”)
- Chrome crashes after several hours while multiprocessing using Selenium through Python
- How to accept the popup presented when installing extension in Selenium?
- How to solve ‘Getting Default Adapter failed’ error when launching Chrome and try to access a webpage using the ChromeDriver using Selenium
- Why switching to alert through selenium is not stable?
- Chrome browser initiated through ChromeDriver gets detected
- WebDriverException: Service U:/Scraping/chromedriver.exe unexpectedly exited. Status code was: 1 while working with Chrome and Python
- Selenium can’t open a second page