aboutsummaryrefslogtreecommitdiff
path: root/e3372.py
blob: 6cfa2464f1ee4a0933088703280f7f9bc1a4f447 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import requests
from bs4 import BeautifulSoup

class E3372:
    def __init__(self, ip: str):
        self.ip = ip
        self.headers = {}
        pass

    def auth(self):
        soup = self._request("webserver/SesTokInfo")
        print(soup)

    def _request(self, endpoint: str, method='GET'):
        url = f"http://{self.ip}/api/{endpoint}"
        r = requests.get(url) if method == 'GET' else requests.post(url)
        return BeautifulSoup(r.text, "lxml")