Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- from itertools import cycle
- from selenium.webdriver import Chrome, ChromeOptions
- options = ChromeOptions()
- # https://help.applitools.com/hc/en-us/articles/360007189411--Chrome-is-being-controlled-by-automated-test-software-notification
- options.add_experimental_option("excludeSwitches", ['enable-automation'])
- # fullscreen
- options.add_argument("--kiosk")
- # profile for cookies tec.
- options.add_argument("--user-data-dir=chrome_profile")
- driver = Chrome(options=options)
- # lazy way of putting urls in a list
- urls = "http://google.de http://golem.de http://heise.de http://bild.de".split()
- # get the first url
- driver.get(urls[0])
- # now new tab -> get next url
- for url in urls[1:]:
- driver.switch_to.new_window()
- driver.get(url)
- # cycle through tabs
- for handle in cycle(driver.window_handles):
- driver.switch_to.window(handle)
- time.sleep(5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement