My goal is to extract the username and / values from a series of gists on Github Gists. The challenge lies in the fact that there are no identifiable classes or IDs for the / value.
https://i.stack.imgur.com/9d0kl.png
Below is the HTML snippet with a link to the Github Gists page and JSFiddle:
<div class="d-inline-block">
<span>
<a data-hovercard-type="user" data-hovercard-url="/hovercards?user_id=167012" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self"
href="/hanachin">hanachin</a>
/
<a href="/hanachin/2060751fca3444922386879ac666541e">
<strong class="css-truncate-target">file0.txt</strong>
</a>
</span>
<div class="text-gray" style="font-size:11px;">
Last active
<time-ago datetime="2019-03-08T08:24:35Z">Mar 8, 2019</time-ago>
</div>
<span class="f6 text-gray">
Ruby 2.7 ref:
<a href="https://qiita.com/hanachin_/items/1aa1ba38a87dee91aed6" rel="nofollow">https://qiita.com/hanachin_/items/1aa1ba38a87dee91aed6</a>
</span>
</div>
I have managed to remove the icon and username using the following code:
[data-hovercard-type="user"] {
display:none;
}
[data-hovercard-type="user"] img {
display:none;
}
However, I am facing difficulty in accessing the / as it does not have any assigned classes and seems to be part of a node/#textnode. How can I extract this information?