Iam trying to update the background color of the span using python advanced-htmlParser
I have html page status.html, on which iam trying to parse and updating the color of the span and this updated color should reflect when the page get loaded
# Following are the content of Status.html
<html>
<style type="text/css">
.Table
{
display: table;
}
.Title
{
display: table-caption;
text-align: center;
font-weight: bold;
font-size: larger;
}
.Heading
{
display: table-row;
font-weight: bold;
text-align: center;
}
.Row
{
display: table-row;
}
.Cell
{
display: table-cell;
border: solid;
border-width: thin;
padding-left: 20px;
padding-right: 20px;
}
</style>
<h1>"The dns ip is: " <span id="myID"></span></h1>
<div class="Heading">
<div Class="Cell">
<p>G</p>
</div>
<div Class="Cell">
<p>facebook.com</p>
</div>
<div id="test">
<span id="h" class="Cell">
<p>H</p>
</span>
<span id="e" class="cell">
<p>E</p>
</span>
<span id ="Time" class="Cell">
<P> </P>
</span>
</div>
<div Class="Cell">
<p></p>
</div>
</div>
</html>
#Blow is the code iam trying to update the backround color of the span_Id 'h'.
import AdvancedHTMLParser
parser = AdvancedHTMLParser.AdvancedHTMLParser()
path = "D:/Status.html"
parser.parseFile(path)
parser.getElementById('h').style.background="yellow"
Expected: The background of
H should update with the yellow color
Actual: No update is happening once after execute the script
Appreciate if any one can help on this?