def get_html_tree():
"""Gets and converts the management interface page into a parsable tree."""
try:
with requests.Session() as s:
s.get(_config['base_url'] + _config['welcome_page'],
data=_config['welcome_credentials'])
s.post(_config['base_url'] + _config['login_page'],
data=_config['login_credentials'])
r = s.get(_config['base_url'] + _config['management_page'])
except Exception as e:
logging.error(str(e))
raise e
return html.fromstring(r.content)
评论列表
文章目录