So your final code would look like:
import requests
from selenium import webdriver
from datetime import datetime as dt
import re
import time
from selenium.webdriver.chrome.options import Options
from selenium.common.exceptions import ElementNotVisibleException
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.by import By
# set driver options
chrome_options = Options()
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--window-size=1420,1080')
chrome_options.add_argument('--headless')
chrome_options.add_argument('--disable-dev-shm-usage')
chrome_options.add_argument('--disable-gpu')
chrome_options.add_argument("--disable-notifications")
chrome_options.add_argument("--remote-debugging-port=9222")
chrome_options.add_experimental_option("excludeSwitches", ["enable-automation"])
chrome_options.add_experimental_option('useAutomationExtension', False)
chrome_options.add_experimental_option("excludeSwitches", ["disable-popup-blocking"])
events = ['https://www.bandsintown.com/e/1024970351-alukah-at-high-noon-saloon?came_from=253&utm_medium=web&utm_source=city_page&utm_campaign=event', 'https://www.bandsintown.com/e/103265416-bill-roberts-combo-at-come-back-in?came_from=253&utm_medium=web&utm_source=city_page&utm_campaign=event', 'https://www.bandsintown.com/e/1022530728-chiiild-at-the-sylvee?came_from=253&utm_medium=web&utm_source=city_page&utm_campaign=event', 'https://www.bandsintown.com/e/103243450-aimee-mann-at-stoughton-opera-house?came_from=253&utm_medium=web&utm_source=city_page&utm_campaign=event', 'https://www.bandsintown.com/e/1022530781-leon-bridges-at-the-sylvee?came_from=253&utm_medium=web&utm_source=city_page&utm_campaign=event', 'https://www.bandsintown.com/e/103338969-jonathan-coulton-at-stoughton-opera-house?came_from=253&utm_medium=web&utm_source=city_page&utm_campaign=event', 'https://www.bandsintown.com/e/1024312079-necronomicon-at-high-noon-saloon?came_from=253&utm_medium=web&utm_source=city_page&utm_campaign=event', 'https://www.bandsintown.com/e/103395650-jon.-at-jitters-coffeehouse?came_from=253&utm_medium=web&utm_source=city_page&utm_campaign=event', 'https://www.bandsintown.com/e/1024311602-the-convalescence-at-high-noon-saloon?came_from=253&utm_medium=web&utm_source=city_page&utm_campaign=event', 'https://www.bandsintown.com/e/1024691276-todd-sheaffer-at-the-bur-oak?came_from=253&utm_medium=web&utm_source=city_page&utm_campaign=event', 'https://www.bandsintown.com/e/103127087-alec-benjamin-at-the-sylvee?came_from=253&utm_medium=web&utm_source=city_page&utm_campaign=event', 'https://www.bandsintown.com/e/1024272496-sara-kays-at-the-sylvee?came_from=253&utm_medium=web&utm_source=city_page&utm_campaign=event']
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=chrome_options)
for event in events:
print("getting event")
driver.get(event)
time.sleep(3)
print(driver.title)
With the output being:
====== WebDriver manager ======
Current google-chrome version is 101.0.4951
Get LATEST chromedriver version for 101.0.4951 google-chrome
Driver [/Users/bilalakhtar/.wdm/drivers/chromedriver/mac64_m1/101.0.4951.41/chromedriver] found in cache
getting event
Alukah Madison Tickets, High Noon Saloon May 02, 2022 | Bandsintown
getting event
Bill Roberts Combo Madison Tickets, Come Back In May 02, 2022 | Bandsintown
getting event
Chiiild Madison Tickets, The Sylvee May 02, 2022 | Bandsintown
getting event
Aimee Mann Stoughton Tickets, Stoughton Opera House May 02, 2022 | Bandsintown
getting event
Leon Bridges Madison Tickets, The Sylvee May 02, 2022 | Bandsintown
getting event
Jonathan Coulton Stoughton Tickets, Stoughton Opera House May 02, 2022 | Bandsintown
getting event
Necronomicon Madison Tickets, High Noon Saloon May 02, 2022 | Bandsintown
getting event
Jon. Whitewater Tickets, Jitters Coffeehouse May 02, 2022 | Bandsintown
getting event
The Convalescence Madison Tickets, High Noon Saloon May 02, 2022 | Bandsintown
getting event
Todd Sheaffer Madison Tickets, The Bur Oak May 02, 2022 | Bandsintown
getting event
Alec Benjamin Madison Tickets, The Sylvee May 03, 2022 | Bandsintown
getting event
Sara Kays Madison Tickets, The Sylvee May 03, 2022 | Bandsintown
Process finished with exit code 0
* Be the first to Make Comment