title: How do I close live chat window without cross using selenium?
body: <p>I am trying to scrape the reviews from this page <a href="https://everdeskplus.com/products/everdesk-max" rel="nofollow noreferrer">https://everdeskplus.com/products/everdesk-max</a> but I am stuck with this error. I need it to click the '&gt;' button until it reaches the last page. It does not allow me to click the '&gt;' button and said that it cannot be found.</p>
  <pre><code>from selenium import webdriver
  from selenium.webdriver.support.wait import WebDriverWait
  from selenium.webdriver.support import expected_conditions as EC
  from selenium.webdriver.common.by import By
  
  driver = webdriver.Chrome()
  driver.maximize_window()
  driver.implicitly_wait(10)
  
  driver.get(&quot;https://everdeskplus.com/products/everdesk-max&quot;)
  
  wait = WebDriverWait(driver,30)
  
  # Close Spin pop-up
  wait.until(EC.element_to_be_clickable((By.XPATH,&quot;//div[@id='pge_HN8znV-LA']/div[1]/span&quot;))).click()
  
  
  # Switch to Iframe and close the chat box
  wait.until(EC.frame_to_be_available_and_switch_to_it((By.ID,&quot;chat-button&quot;)))
  wait.until(EC.element_to_be_clickable((By.XPATH,&quot;//button[@id='gorgias-chat-messenger-button']&quot;))).click()
  
  #Switch back to the default content
  driver.switch_to.default_content()
  
  # Scroll to the footer and click on &quot;Next&quot; page button 
  footer = driver.find_element_by_class_name(&quot;stamped-pagination stamped-reviews-ul&quot;)
  driver.execute_script(&quot;arguments[0].scrollIntoView(true);&quot;,footer)
  nextbutton = wait.until(EC.element_to_be_clickable((By.XPATH,&quot;'//*[@id='stamped-reviews-tab']/ul/li[14]/a'&quot;)))
  nextbutton.click()
  
  </code></pre>
  <p>This is the error I got:</p>
  <pre><code>
  ---------------------------------------------------------------------------
  NoSuchElementException                    Traceback (most recent call last)
  &lt;ipython-input-4-de1d77662195&gt; in &lt;module&gt;
       21 
       22 # Scroll to the footer and click on &quot;Next&quot; page button
  ---&gt; 23 footer = driver.find_element_by_class_name(&quot;stamped-pagination stamped-reviews-ul&quot;)
       24 driver.execute_script(&quot;arguments[0].scrollIntoView(true);&quot;,footer)
       25 nextbutton = wait.until(EC.element_to_be_clickable((By.XPATH,&quot;'//*[@id='stamped-reviews-tab']/ul/li[14]/a'&quot;)))
  
  ~\anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py in find_element_by_class_name(self, name)
      562             element = driver.find_element_by_class_name('foo')
      563         &quot;&quot;&quot;
  --&gt; 564         return self.find_element(by=By.CLASS_NAME, value=name)
      565 
      566     def find_elements_by_class_name(self, name):
  
  ~\anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py in find_element(self, by, value)
      974                 by = By.CSS_SELECTOR
      975                 value = '[name=&quot;%s&quot;]' % value
  --&gt; 976         return self.execute(Command.FIND_ELEMENT, {
      977             'using': by,
      978             'value': value})['value']
  
  ~\anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py in execute(self, driver_command, params)
      319         response = self.command_executor.execute(driver_command, params)
      320         if response:
  --&gt; 321             self.error_handler.check_response(response)
      322             response['value'] = self._unwrap_value(
      323                 response.get('value', None))
  
  ~\anaconda3\lib\site-packages\selenium\webdriver\remote\errorhandler.py in check_response(self, response)
      240                 alert_text = value['alert'].get('text')
      241             raise exception_class(message, screen, stacktrace, alert_text)
  --&gt; 242         raise exception_class(message, screen, stacktrace)
      243 
      244     def _value_or_default(self, obj, key, default):
  
  NoSuchElementException: Message: no such element: Unable to locate element: {&quot;method&quot;:&quot;css selector&quot;,&quot;selector&quot;:&quot;.stamped-pagination stamped-reviews-ul&quot;}
    (Session info: chrome=95.0.4638.54)
  </code></pre>