I'm looking to use REGEX to extract quantity out of a shopping website. In the following example, I want to get "12.5 kilograms". However, the quantity within the first span is not always listed in kilograms; it could be lbs., oz., etc.
<td class="size-price last first" colspan="4">
<span>12.5 kilograms </span>
<span> <span class="strike">$619.06</span> <span class="price">$523.91</span>
</span>
</td>
The code above is only a small portion of what is actually extracted using BeautifulSoup. Whatever the page is, the quantity is always within a span and is on a new line after
<td class="size-price last first" colspan="4">
I've used REGEX in the past but I am far from an expert. I'd like to know how to match elements between different lines. In this case between
<td class="size-price last first" colspan="4">
and
<span> <span class="strike">