title: Can't click on webpage element using python selenium when used with mobile user-agent
body: <p>I am trying to automate clicking on the play button of an embedded iframe music player on a webpage, I am coding using python 3 and Selenium to select the element to click.</p>
  
  <p>When the user-agent is changed to replicate a mobile device, a wrapper layer then obscures the button that I can normally click, it asks if I want to listen on the main site or in the browser. I want to listen in the browser, but so far everything I have tried to click the correct element to achieve that, has failed.</p>
  
  <p>I believe I am clicking on the wrong part but cannot find a way to access the correct part.</p>
  
  <p>The inspect window of the browser shows the below for the part of the wrapper I need to click on:</p>
  
  <pre><code>&lt;a class="mobilePrestitial__link sc-font-light" href="#"&gt;
      Listen in browser
    &lt;/a&gt;
    ::before
  "
      Listen in browser
      "
      /a&gt;
  </code></pre>
  
  <p>When I hover over the ::before part it highlights the part in the browser that I believe I need to click, but using right-click to inspect ::before just says 'scroll in view' so I cannot copy whatever the element represents.</p>
  
  <p>My current code is this:</p>
  
  <pre><code>driver.switch_to.default_content()
  driver.switch_to.frame(driver.find_element_by_partial_link_text('Listen in browser'))          
  element = WebDriverWait(driver, 10).until(
      EC.element_to_be_clickable((By.XPATH, '//a[@class="mobilePrestitial__link"]'))
  )
  element.click()
  </code></pre>
  
  <p>But it errors without a message, I suspect I need to be clicking on the element presented by ::before but cannot figure how to do that.</p>