Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python loop chrome

#import from selenium driver
from selenium import webdriver
#import from use of Key actions && Action chains (commands) from selenium driver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.by import By
import time


#designate each URL to be opened
url_1 = 'https://www.google.com/'
url_2 = 'https://github.com/'
url_3 = 'https://www.kaggle.com/'

#designate webdriver as chrome
driver = webdriver.Chrome()

#open 1st URL in first tab
driver.get(url_1)

#wait 
driver.implicitly_wait(15)

#open new window (tab 2) and switch over to it
driver.execute_script("window.open('');")
driver.switch_to.window(driver.window_handles[1])

#open 2nd URL in current tab
driver.get(url_2)

#wait 
driver.implicitly_wait(15)

#open new window (tab 3) and switch over to it
driver.execute_script("window.open('');")
driver.switch_to.window(driver.window_handles[2])

#open 3rd URL in current tab
driver.get(url_3)

#wait 
driver.implicitly_wait(15)
Comment

PREVIOUS NEXT
Code Example
Python :: how to read comment before the root element of xml python 
Python :: Select a Column in pandas data Frame Using Brackets 
Python :: automl time series forecasting 
Python :: how to go from a url with a zip file to a csv 
Python :: pyteal atomic transfer 
Python :: Python print traceback when error occurs in a class 
Python :: Remove outliers with median value and Capping 
Python :: Add extra data to Django notifications model object (extend the notify signal) 
Python :: stack overflow pop item from list in python 
Python :: Custom RGB To Hex Conversion with Python 
Python :: How to run python in command promt 
Python :: negative index python 
Python :: Different ways to test multiple 
Python :: adding multiple items to a list python 
Python :: Function to stop a while loop 
Python :: scrapping components of webpage 
Python :: design patterns python - restrict what methods of the wrapped class to expose 
Python :: The float type in Python3 can represent decimal 0.1 without error. 
Python :: create a number of variables based on input in python 
Python :: panda3d intervals 
Python :: pandas assign multiple columns 
Python :: self argument in python 
Python :: database access layer django 
Python :: generate natural numbers python 
Python :: Using iterable unpacking operator * 
Python :: python map and filter 
Python :: the best ide for python 
Python :: python bill 
Python :: c# script for download music from telegram channel 
Python :: wxPython wx.Window Connect example 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =