title: Python - Selenium webdriver timeout exception error-2
body: <p>My goal is to access the IMDB site from a different website and try to get movie genres.</p>
  <p>This is the main page: <code>driver.get(&quot;https://sfy.ru/scripts&quot;) # main website</code></p>
  <blockquote>
  <p>NOTE: You might get a &quot;certificate is not valid error&quot;. Please set your computer date:07/12/2020</p>
  </blockquote>
  <p>Here is my code:</p>
  <pre><code>from selenium.webdriver.support.ui import WebDriverWait
  from selenium.webdriver.support import expected_conditions as EC
  from selenium.webdriver.common.by import By
  
  driver = webdriver.Chrome()
  
  driver.get(&quot;https://sfy.ru/scripts&quot;) #main site
  
  i = 4
  driver.find_element_by_xpath(&quot;/html/body/div/div[2]/div[1]/p[{}]/a&quot;.format(i)).click()
  
  driver.find_element_by_link_text(&quot;More info about this movie on IMDb.com&quot;).click()
  
  
  genres = WebDriverWait(driver, 10).until(EC.presence_of_all_elements_located((By.XPATH, &quot;//h4[.='Genres:']/following-sibling::a&quot;)))
  
  aa = (&quot;, &quot;.join([genre.text for genre in genres]))
  
  print(aa)
  </code></pre>
  <p>ERROR:</p>
  <pre><code>---------------------------------------------------------------------------
  TimeoutException                          Traceback (most recent call last)
  &lt;ipython-input-13-e29dcd0a9a9b&gt; in &lt;module&gt;
       13 
       14 
  ---&gt; 15 genres = WebDriverWait(driver, 10).until(EC.presence_of_all_elements_located((By.XPATH, &quot;//h4[.='Genres:']/following-sibling::a&quot;)))
       16 
       17 aa = (&quot;, &quot;.join([genre.text for genre in genres]))
  
  ~\Anaconda3\lib\site-packages\selenium\webdriver\support\wait.py in until(self, method, message)
       78             if time.time() &gt; end_time:
       79                 break
  ---&gt; 80         raise TimeoutException(message, screen, stacktrace)
       81 
       82     def until_not(self, method, message=''):
  
  TimeoutException: Message: 
  </code></pre>
  <p>The purpose of using this code is:</p>
  <pre><code>i = 4
  driver.find_element_by_xpath(&quot;/html/body/div/div[2]/div[1]/p[{}]/a&quot;.format(i)).click()
  </code></pre>
  <p>this page has lists of movies (<code>driver.get(&quot;https://sfy.ru/scripts&quot;)</code>). With the redirect link here (<code>driver.find_element_by_link_text(&quot;More info about this movie on IMDb.com&quot;).click()</code>), I try to access IMDB pages and get the genres of each film.</p>
  <p>So, I have to create a loop to get the genres of all the movies. That's why I am trying to use that code.</p>
  <p>What should I change in my code?</p>