title: Expected conditions with selenium
body: <p>How do i check if a <code>br</code> tag is present in HTML using expected conditions. This is the HTML code:</p>
  
  <pre><code>&lt;br&gt;
  &lt;a href="member.php?u=12455" rel="nofollow"&gt;Smatta&lt;/a&gt;
  &lt;a&gt;, &lt;/a&gt;
  &lt;a href="member.php?u=14305" rel="nofollow"&gt;Nyunyu&lt;/a&gt;
  &lt;a&gt;, &lt;/a&gt;
  &lt;a href="member.php?u=20892" rel="nofollow"&gt;moyo&lt;/a&gt;
  &lt;a&gt;, &lt;/a&gt;
  &lt;a href="member.php?u=21040" rel="nofollow"&gt;Masikini_Jeuri&lt;/a&gt;
  &lt;a&gt;, &lt;/a&gt;
  &lt;a href="member.php?u=27429" rel="nofollow"&gt;Job K&lt;/a&gt;
  &lt;a&gt;, &lt;/a&gt;
  &lt;a href="member.php?u=38124" rel="nofollow"&gt;Adoe&lt;/a&gt;
  &lt;a&gt;, &lt;/a&gt;
  &lt;a href="member.php?u=39196" rel="nofollow"&gt;enhe&lt;/a&gt;
  &lt;a&gt;&lt;/a&gt;
  </code></pre>
  
  <p>This is my code.</p>
  
  <pre><code>wait = WebDriverWait(browser, 10)
  wait.until(EC.visibility_of_element_located((By.XPATH, '//&lt;br&gt;')))
  </code></pre>
  
  <p>Full code.</p>
  
  <pre><code>from selenium import webdriver
  from selenium.webdriver.common.by import By
  from selenium.webdriver.support.ui import WebDriverWait
  from selenium.webdriver.support import expected_conditions as EC
  
  browser = webdriver.PhantomJS()
  browser.maximize_window()
  browser.get("http://www.jamiiforums.com/kenyan-news/225589-kenyan-and-tanzanian-surburbs.html")
  
  username = browser.find_element_by_id("navbar_username")
  password = browser.find_element_by_name("vb_login_password_hint")
  
  username.send_keys("MarioP")
  password.send_keys("codeswitching")
  
  browser.find_element_by_class_name("loginbutton").click()
  
  wait = WebDriverWait(browser, 20)
  wait.until(EC.visibility_of_element_located((By.XPATH, '//h2[contains(., "Redirecting")]')))
  wait.until(EC.title_contains('Kenyan &amp; Tanzanian'))
  wait.until(EC.visibility_of_element_located((By.ID, 'postlist')))
  
  browser.find_element_by_xpath('//div[@class="vbseo_liked"]/a[contains(@onclick, "return vbseoui.others_click(this)")]')
  browser.find_element_by_class_name("vbseo_liked").click()
  
  wait.until(EC.visibility_of_element_located((By.TAG_NAME, 'br')))
  print (browser.page_source)
  
  print 'success!!'
  browser.close()
  </code></pre>
  
  <p>The reason I am doing that is because the br tag only appears after a link has been clicked. I am trying to get the page source after the click action, but it gives me the page source before the click action. I wanted to check the presence of the br tag before i get the page source.</p>
  
  <p>This is the error it prints out.</p>
  
  <blockquote>
    <p>File "sele.py", line 29, in 
        wait.until(EC.visibility_of_element_located((By.TAG_NAME, 'br')))</p>
  </blockquote>