Hi I'm trying to extract two strings of information from the inner HTML, but somehow I keep running into errors. Thanks in advance for your help
-
I want to get the text between the first set of tags without class names. In this example I would want to return "Target", however, even if it returned the whole line including the span tags that would be fine too, since I can just clean it up in Excel.
-
I want to get the text between the second set of tags without class names. In this example I would want to return "13 yrs 11 mos", similarly to the first one, even if it returned the whole line including the span tags that would be fine as well.
Below is the output from the innerHTML:
<h3 class="t-16 t-black t-bold">
<span class="visually-hidden">Company Name</span>
<span>Target</span>
</h3>
<h4 class="t-14 t-black t-normal">
<span class="visually-hidden">Total Duration</span>
<span>13 yrs 11 mos</span>
</h4>
Below is the Regex I have tried but unable to get to work:
1. (?<=(<span>))(\w+)(?=(</pre>))
2. I haven't attempted this one yet...