Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # coding: utf-8
- """
- https://2.python-requests.org/en/master/
- """
- from html.parser import HTMLParser
- from html.entities import name2codepoint
- import requests
- #*******************************************************************************
- # HTML PARSER VISOR VAUBAN
- #*******************************************************************************
- class MyHTMLParser(HTMLParser):
- def handle_starttag(self, tag, attrs):
- if (tag!= "table" and tag!="newdataset"):
- print (tag.upper()," = ",end='')
- def handle_endtag(self, tag):
- if (tag=="table" or tag=="newdataset"):
- #print ("*"*80, end ='')
- print ("*********", end ='')
- def handle_data(self, data):
- print (data, end ='')
- #*******************************************************************************
- # MAIN LOOP
- #*******************************************************************************
- visor="http://192.168.6.117:8080/Visor/GetEventList&NumberOfEvents=10&StartDate=2019-05-17%2008:00:00&EndDate=2019-05-18%2020:00:00"
- page = requests.get(visor)
- recup = page.text
- #print (recup) #html
- parser = MyHTMLParser()
- parser.feed (recup)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement