I need to sample and extract only a specific string out of an offline HTML document and write that information nice and clean into a *.txt file.
So for example, lets assume that this is a section of the HTML file:
<span id="dataView01">001.00 SPL</span>
<span id="dataView02">543.00 SPL</span>
<span id="dataView03">056.00 SPL</span>
<span id="dataView04">228.00 SPL</span>
I need to get this as a result:
001.00 SPL
543.00 SPL
056.00 SPL
228.00 SPL
Could you please help me with this,
Thanks.
Use an HTML parser like BeautifulSoup.
Example:
Result:
Next step; write to .txt file: