from selenium import webdriver
chrome_driver_path = "D:\\drivers\\chromedriver.exe"
driver=webdriver.Chrome(chrome_driver_path)
import requests
for link in links:
r = requests.head(link)
if r.status_code!=404:
driver.get(link)
else:
print(str(link) + " isn't available.")