I am scraping this page https://www.betexplorer.com/soccer/russia/premier-league-2014-2015/results/ but sometimes the browser dont load the page or website cant be reached. How could i fix this problem ?
home = 'https://www.betexplorer.com/soccer/russia/premier-league-2014-2015/results/'
driver.get(home)
for i in range(1):
scroll = driver.find_element_by_tag_name('body').send_keys(Keys.END)
l=driver.find_elements_by_xpath("//a[@class='in-match']")
urls=[]
for i in range(len(l)):
urls.append(l[i].get_attribute('href'))
for i in urls:
driver.get(i)
sleep(5)
date=WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.ID, 'match-date'))).text
hometeam=WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.XPATH, '/html/body/div[4]/div[5]/div/div/div[1]/section/ul[2]/li[1]/figure/div/a/img'))).get_attribute("alt")
awayteam=WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.XPATH, '/html/body/div[4]/div[5]/div/div/div[1]/section/ul[2]/li[3]/figure/div/a/img'))).get_attribute("alt")
ft=WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.ID, 'js-score'))).text