title: How to click the button and get the source of new page with python-selenium?
body: <p>I wish to click the <code>next</code> button till the end and scrape all the sources of the page. My code is as below:</p>
  
  <pre><code>from selenium import webdriver  
  from selenium.common import exceptions  
  from selenium.webdriver.common.keys import Keys
  import time
  
  browser = webdriver.Firefox()  
  browser.get('https://s.taobao.com/search?q=%E5%8F%A3%E7%BD%A9+%E9%9D%A2%E7%BA%B1')  
  sources = []
  for i in range(100):
      sources.append(browser.page_source)
      browser.find_element_by_css_selector("li.item.next &gt; a.J_Ajax.num.icon-tag").click()
  time.sleep(8)
  browser.quit()
  </code></pre>
  
  <p>But all the sources are from the first page, when I have already wait for 8 seconds in each page and I see the images are finished loading. Could you please tell me what is the reason and how can I solve it? Thanks!</p>