Python - Selenium : Scroll down not working because of PopUp
<p>I am writing a python script using selenium to login to Facebook and then do some scrapping. For that purpose, <strong>I have to scroll down to the bottom of the page. I think the pop that you can see in the picture is the cause of this.</strong>
Here is the snippet of code which does the following thing</p>

<pre><code>elem = driver.find_element_by_id("email")
elem.send_keys(usr)
elem = driver.find_element_by_id("pass")
elem.send_keys(pwd)
elem.send_keys(Keys.RETURN)

driver.get("https://www.facebook.com/jatin.wadhwa.52/friends?source_ref=pb_friends_tl")
time.sleep(10)

element_new = driver.find_element_by_tag_name('html')
element_new.send_keys(Keys.ESCAPE)
element_new.send_keys(Keys.END)

#driver.execute_script("window.scrollTo(0, 1000);")
f = driver.find_elements_by_xpath("//ul")
</code></pre>

<p><a href="http://i.stack.imgur.com/ryA44.png" rel="nofollow"><img src="http://i.stack.imgur.com/ryA44.png" alt="Picture of Pop up on browser"></a></p>

<p>Solved.</p>

<p>Adding this will resolve and woulndt allow any such pop ups.</p>

<pre><code>    chrome_options = webdriver.ChromeOptions()
    prefs = {"profile.default_content_setting_values.notifications" : 2}
    chrome_options.add_experimental_option("prefs",prefs)
    #driver = webdriver.Chrome(chrome_options=chrome_options)

driver = webdriver.Chrome(r"C:\Users\jatin\Downloads\chromedriver_win32\chromedriver.exe",chrome_options=chrome_options)
</code></pre>

python facebook selenium