I am trying to get the value #2011 which is a URL text from the HTML below. I tried the below code but didnt work. It says it is unable to locate the class
driver.find_element(By.XPATH, '//span[@class = "data-issue-and-pr-hovercards-enabled"]').get_attribute('a')
Can anyone help to correct the mistake? I am new to selenium.
<span data-issue-and-pr-hovercards-enabled>
<span><span> · Fixed by <a href="https://github.com/mlpack/mlpack/pull/2011" data-hydro-click="{"event_type":"issue_cross_references.click","payload":{"reference_location":"ISSUE_HEADER","user_id":8344482,"issue_id":490664092,"pull_request_id":315249262,"originating_url":"https://github.com/mlpack/mlpack/issues/2008"}}" data-hydro-click-hmac="aadfd36202d72a8e9a7ce379994bac18a7e2052adfb12d43eea1c8f41e12bfde" data-hovercard-type="pull_request" data-hovercard-url="/mlpack/mlpack/pull/2011/hovercard">#2011</a></span><span></span></span>
</span>
Here is the link to the website - github.com/mlpack/mlpack/issues/2008 I want to get the #2011 which is next to the Fixed by Text (below the title of the issue). Is it possible to do this?