Python 3 + Selenium: Clicked the element but nothing happen
<p>The element was clicked and I didn't get any error but the popup ("add featured photos" popup in Facebook) is still there. It is not closed. </p>

<p>This is html code:</p>

<pre><code>&lt;div class="_5lnf uiOverlayFooter _5a8u"&gt;
   &lt;table class="uiGrid _51mz uiOverlayFooterGrid" cellspacing="0" cellpadding="0"&gt;
      &lt;tbody&gt;
          &lt;tr class="_51mx"&gt;
             &lt;td class="_51m- prs uiOverlayFooterMessage"&gt;
             &lt;td class="_51m- uiOverlayFooterButtons _51mw"&gt;
                &lt;a class="_42ft _4jy0 layerCancel uiOverlayButton _4jy3 _517h _51sy" href="#" role="button"&gt;Cancel&lt;/a&gt;
                &lt;button class="_42ft _4jy0 layerConfirm uiOverlayButton _4jy3 _4jy1 selected _51sy" type="submit" value="1"&gt;Save&lt;/button&gt;
             &lt;/td&gt;
         &lt;/tr&gt;
      &lt;/tbody&gt;
   &lt;/table&gt;
&lt;/div&gt;
</code></pre>

<p>And this is my code:</p>

<pre><code>driver.find_element_by_xpath(".//button[@class='_42ft _4jy0 layerConfirm uiOverlayButton _4jy3 _4jy1 selected _51sy']") 
</code></pre>

<p>How to click "save" button to close popup ? Thank you very much :)</p>

<p>You can scroll to the button before clicking to it</p>

<pre><code>from selenium.webdriver.common.action_chains import ActionChains

button = driver.find_element_by_xpath(".//button[@class='_42ft _4jy0 layerConfirm uiOverlayButton _4jy3 _4jy1 selected _51sy']")
ActionChains(driver).move_to_element(button).perform()
button.click()
</code></pre>

javascript python facebook selenium xpath