title: Find element text using xpath in selenium-python NOt Working
body: <p><a href="https://i.stack.imgur.com/YeWw5.png" rel="nofollow noreferrer">html looks like this</a>I have written this code to scrape all courses from a url. For this I am trying to get the count of courses using <code>xpath</code>. But it does not give me anything. Where I am doing wrong?</p>
  
  <pre><code>import requests
  from bs4 import BeautifulSoup
  from selenium import webdriver
  from time import sleep
  from selenium.webdriver.common.by import By
  from selenium.webdriver.support import expected_conditions as EC
  from selenium.webdriver.support.ui import WebDriverWait`
  </code></pre>
  
  <p><code>class FinalProject:</code></p>
  
  <pre><code>    def __init__(self,url= "https://www.class-central.com/subject/data-science"):`
          self.url = url
          base_url = 'https://www.class-central.com'
          self.error_flag = False
          self.driver = webdriver.Chrome(&lt;path to chromedriver&gt;)
          self.driver.get(self.url)
          sleep(2)
          self.count_course_and_scroll()
  
      def count_course_and_scroll(self):
          wait = WebDriverWait(self.driver, 30);
          ele = wait.until(EC.presence_of_element_located((By.PARTIAL_LINK_TEXT, 'Not right now, thanks.')));
          ele.click()
          print "----------------------POP UP CLOSED---------------------"
          total_courses = self.driver.find_element_by_xpath("//span[@id='number-of-courses']")
          print total_courses
          print total_courses.text
          self.driver.close()
  </code></pre>
  
  <p><code>fp = FinalProject()</code></p>