I am parsing a HTML Page using Python + lxml etree and I am able to extract all data present within HTML tags. Few static data is embedded within javascript and I am unable to parse it. E.g
<td valign="top" width="80%">
<script language="javascript" type="text/javascript">
function AddItem() {
.
.
.
if (st.value == 'VAL1') {
strValues = document.getElementById('Element1').value;
}
else if (st.value == 'VAL2') {
strValues = document.getElementById('Element2').value;
}
else if (st.value == 'VAL3') {
strValues = document.getElementById('Element3').value;
}
.
.
.
</script>
</td>
I would like to extract data as follows
{ VAL1 : Element1 , VAL2 : Element2 , VAL3 : Element3 }
Let me know if this is possible using python