title: How to click on this 'a' tag with selenium in python
body: <p>I have this element</p>
  <pre><code>&lt;p&gt;&lt;a onclick=&quot;return getpermission(this);&quot; id=&quot;ctl00_ContentPlaceHolder1_btnSub&quot; class=&quot;btn btn-danger&quot; data-endisbutton=&quot;&quot; href=&quot;javascript:__doPostBack('ctl00$ContentPlaceHolder1$btnSub','')&quot;&gt;▼ Taylor-Swift-Bad-Blood-ft.-Kendrick-Lamar.srt&lt;/a&gt; &lt;strong&gt;Subtitle (.SRT) &lt;/strong&gt;&lt;/p&gt;
  </code></pre>
  <p><a href="https://www.rentanadviser.com/subtitles/getsubtitle.aspx?artist=Taylor%20Swift&amp;song=Bad%20Blood%20ft.%20Kendrick%20Lamar" rel="nofollow noreferrer">on this page</a> and I want to click on 'a' tag, so I found the 'a'tag element(&quot;elem&quot;) and ran (1st way) <code>elem.click()</code> then recieved</p>
  <pre><code>selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element &lt;a onclick=&quot;return getpermission(this);&quot; id=&quot;ctl00_ContentPlaceHolder1_btnSub&quot; class=&quot;btn btn-danger&quot; data-endisbutton=&quot;&quot; href=&quot;javascript:__doPostBack('ctl00$ContentPlaceHolder1$btnSub','')&quot;&gt;...&lt;/a&gt; is not clickable at point (185, 668). Other element would receive the click: &lt;a href=&quot;https://www.rentanadviser.com/downloads/kripto_video_protector_setup.exe&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;...&lt;/a&gt;
    (Session info: chrome=99.0.4844.82)
  </code></pre>
  <p>then ran (2nd way)</p>
  <pre><code>from selenium.webdriver.common.action_chains import ActionChains
  action=ActionChains(driver)
  action.move_to_element(elem)#or the line below
  action.move_to_element_with_offset(elem,0,80)
  action.click()
  action.perform()
  </code></pre>
  <p>then got error:</p>
  <pre><code>selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document
    (Session info: chrome=99.0.4844.82)
  </code></pre>
  <p>then did (3rd way) in which first element of elem1 is the elem(a tag)</p>
  <pre><code>driver.execute_script(&quot;arguments[0].click;&quot;, elem1)
  </code></pre>
  <p>which doesn't do anything.</p>
  <p>btw this way I found 'elem'</p>
  <pre><code>links=driver.find_elements_by_tag_name(&quot;p&quot;)
      for i in range(len(links)):
          strong=links[i].find_elements_by_tag_name('strong')
          if l(strong)&gt;0:
              if links[i].find_elements_by_tag_name('strong')[0].text=='Subtitle (.SRT)':
                  elem=links[i].find_elements_by_tag_name('a')[0]
  </code></pre>