title: Get Image by Class and Click using Selenium Python
body: <p>I'm trying to get all images from the image class profile_view_img_5087188 but there are multiple classes "profile_view_img_xxxxxx" in the page source and fewer from them containing the same url of an image let says that classes containing image </p>
  
  <pre><code>http://i.imgur.com/oraB49H.png
  </code></pre>
  
  <p>and I want to click if the above image url found </p>
  
  <pre><code>&lt;head&gt;&lt;style type="text/css"&gt;.profile_view_img_5087188 { background-image: url('http://i.imgur.com/oraB49H.png'); }&lt;/style&gt;&lt;/head&gt;
  
  
  
  &lt;a class="cursor earn_pages_button profile_view_img_5087188" onclick="startlink52efa('newlookskincenter','follow','99218',16837);imageWin('http://instagram.com/newlookskincenter','Instagram','99218','newlookskincenter','qFVnV5xlY2OJaW4','1015','500','follow',16837)"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>here is my code but doesn't work </p>
  
  <pre><code>            like_button = browser.find_elements_by_css_selector("div &gt; span &gt; a")
              for links in like_button:
                      if "http://i.imgur.com/oraB49H.png" in link.get_attribute('href'):
                              links.click()
  </code></pre>