<p style="font-size: small;" class="apple"><a name="XREF_4567_Figure1_1"></a>Assembly, 1234, 456 & 789</p>
<div align="center"><image alt="apple.jpg" id="image2" source="assets/apple.jpg" />
</div>
In the above html code we need to extract "Assembly, 1234, 456 & 789" and "apple.jpg"
And my python code is below
for line in f:
if 'div align' in line.lower():
#get value after class="
myline=line.split("alt=\"")
#get value before "
number=myline[1].split("\"")[0]
numbers[i].append(number)
#print(count)
#subtract oldcount to find the count of hotspots in current file
count[i].append(0)
count[i].append(len(numbers[i])-oldcount)
i = i + 1
#print(i)