MCPcopy Create free account
hub / github.com/adobe/Marinus / MyHTMLParser

Class MyHTMLParser

python3_cron_scripts/get_azure_data.py:37–59  ·  view source on GitHub ↗

Create a subclass and override the handler methods.

Source from the content-addressed store, hash-verified

35
36
37class MyHTMLParser(HTMLParser):
38 """
39 Create a subclass and override the handler methods.
40 """
41
42 URL = ""
43 logger = LoggingUtil.create_log(__name__)
44
45 def handle_starttag(self, tag, attrs):
46 found = False
47 if tag == "a":
48 for attr in attrs:
49 if (
50 attr[0] == "data-m"
51 and attr[1].find("Azure IP Ranges and Service Tags") != -1
52 ):
53 found = True
54
55 if found:
56 for attr in attrs:
57 if attr[0] == "href":
58 self.logger.info(attr[1])
59 self.URL = attr[1]
60
61
62def requests_retry_session(

Callers 1

mainFunction · 0.70

Calls 1

create_logMethod · 0.80

Tested by

no test coverage detected