Say I have many options in a HTML page (opened as text file) as below,
<select id="my">
<option id="1">1a</option>
<option id="2">2bb</option>
</select>
<select id="my1">
<option id="11">11a</option>
<option id="21">21bb</option>
</select>
Now, I've searched for <select id=
with open('/u/poolla/Downloads/creat/xyz.txt') as f:
for line in f:
line = line.strip()
if '<select id=' in line:
print "true"
Now, whenever <select id=
occurs, I want to get the id value.
that is, copy the string from " after id=
till another " occurs
how do I do this in python?