from HTMLParser import HTMLParser
class MyHTMLParser(HTMLParser):
 def handle_starttag(self,tag,attrs):
  print 'Encountered a start tag: ',tag
 def handle_endtag(self,tag):
  print 'Encountered an end tag: ',tag
 def handle_data(self,data):
  print 'Encountered some data: ',data

parser = MyHTMLParser()
parser.feed('<!DOCTYPE html>'
'<html lang="en-US">'
 '<head>'
  '<title>Programmers Square</title>'
   '					<!--Grouping of selectors is also allowed, like p1,p2,h1 etc-->'
   '<style>'
   '  tr,td{padding: 15px;  text-align:left;}'
   '  tr:hover {background-color: #f5f5f5}'
   ' .left{text-align: left }'
    '.oblique{font-style: oblique;}'
 '    a:link{color:black;}'
 '   a:visited{color:brown;}'
  '  a:hover{color:green;}'
 '   <!--a:active{color:red;} -->'
  '  body {background-color:azure; text-align:center;}'
   ' h1 {text-align:center; font-size:250%; } '
    '#h3 {color:gold;border:1px solid powderblue;padding:10px; '
     '       margin-left:550px;margin-right:550px}'
'    table, th, td{border:1px solid black;}'
 '   table {border-spacing:15 px;}'
  '  table#t1 { width:100%; abckgound-color: #f1f1c1;}'
   ' th, td { padding: 100 px;}'
    'th { tex-align: right;}'
'    img {float:left;}'
 '          '
  ' </style>                                   <!-- Note the #h3, it is the id of h3-->'
'  </head>				   <!-- Just remove the # and see the magic:P -->'
' <body >  <!--This is how you implement colour-->'
 ' <div style: align="center">'
  ' <h1> Programmers Square        </h1>         <!--This is a comment-->'
   ' <hr>'
'   <h2 class="oblique"> The place where coffee turns to code </h2>'
 '  <h3 id="h3" > - striving for gold at' 
'	<abbr title="International Collegiate Programming Contest">ICPC</abbr> </h3>'
''
'				     <!-- Note here, the abbreviation tag is also used-->'
 '  <h4> Link to the facebook page   </h4>'
  ' <a  title="Click to go directly to programmers square fb link"'
   '  href="https://www.facebook.com/groups/584255291715680/?ref=bookmarks" target="_blank"> '
''             
	'	 Click here</a>'
   
   '<div >'
    '<br>              <!-- Just to illustrate that a line can be changed like this-->'
   ' <br>			<!-- to preserve whatever is written as it is, use <pre>   in between targeted places</pre> -->'
  
    
	'					<!-- Use css float instead of tables for the same to easily update later-->'
    
   '<button type="button" onclick="myFunction()">Click to check why image not loaded</button>'
   '<p id="badal">This is a demonstration</p>'
    
 '  <script>'
'	function myFunction()'
'	 {'
'	  document.getElementById("badal").innerHTML = "Because there is no image to illustrate buddhu!!!!";'
'	 }'
 '   </script>'
  '<table style="width:100%"; id="t1" >'
   ' <caption font-size:70%>Behind the scenes</caption>'
    ''
 '   <tr>'
'	<th>Guru Name</th>'
'	<th>Proficiency</th>'
'	<th>Currently in</th>'
'	<th>Contact details</th>'
  '  </tr>'
 '   <tr>'
'	<td>Ajith Vijayan</td>'
'	<td>Techy Knowledge</td>'
'	<td>S7</td>'
'	<td>Coming soon</td>'
  '  </tr>'
 '   <tr>'
'	<td>Arvind Nair</td>'
'	<td>Competitive Programming</td>'
'	<td>S7</td>'
'	<td>Coming soon</td>'
  '  </tr>'
 '   <tr>'
'	<td>Ankur Raja and Mohit Anand</td>'
'	<td>do</td>'
'	<td>S5</td>'
'	<td>Coming soon</td>'
  '  </tr>'
 '   <tr>'
'	<td>Swarup    and Faizan</td>'
'	<td>do</td>'
'	<td>S3</td>'
'	<td>Coming soon</td>'
  '  </tr>'
 '   <tr>'
'	<td>Shantanu , Abhinav</td>'
'	<td>Content Writer</td>'
'	<td>S3</td>'
'	<td>Coming soon</td>'
  '  </tr>'
 ' </table>'
'  <h2 class ="left"> Topics to dive deeper into</h2>'
    
  '  <!-- A detailed list (dl) tag instead of ul will atrract attract more crowd-->'
 '   <ul class="left">'
'	<li>Competitive Programming</li>'
'	<li>Machine learning</li>'
 '       <li>Artificial Intelligence</li>'
'	<li>Web Development</li>'
'	<li>Android App Development</li>'
  '  </ul>'
 '  <h3 class="left"> Keep calm'
'   <p class="left"> Coming Soon </p>'
''    
'                                  <!-- As is evident, if image doesnt load -->'
 '                                     <!--, this alt, or alternative text appears-->'

      
' </body>'
'</html>')
