AS
Size: a a a
AS
SK
RG
RG
RG
RG
AF
МВ
МВ
AF
МК
def get_LocalIP(self):
browser = webdriver.Firefox()
wait = WebDriverWait(browser, 500)
browser.get('http://192.168.31.1/cgi-bin/luci/web')
field = browser.find_element_by_id('password')
wait.until(EC.visibility_of_element_located((By.ID, "password")))
field.send_keys('VideoServer')
browser.find_element_by_id('btnRtSubmit').click()
wait.until(EC.visibility_of_element_located((By.ID, "routermodel")))
current_URL = browser.current_url
current_URL = current_URL.split('/')
XiaomiApiUrlRequest = 'http://192.168.31.1/cgi-bin/luci/' + current_URL[5] + '/api/misystem/devicelist'
r = requests.get(XiaomiApiUrlRequest)
jsonRequest = json.loads(r.text)
jsonRequest = jsonRequest['list']
browser.quit()
HostList = []
for i, val in enumerate(jsonRequest):
ip = val['ip'][0]['ip']
try:
f1 = iFTP(ip)
HostList.append({"ip": ip, "id": val['mac']})
except KeyError:
pass
except ConnectionRefusedError:
pass
# print("No ftp: ", ip)
except TimeoutError:
pass
return HostList
Есть готовый функционал в Qt или как еще можно найти сервера?МВ
МК
МК