Answer the question
In order to leave comments, you need to log in
How to make interface for selenium webdriver program using PyQt5 or other libraries?
Hello, I made a program that in the background starts checking data on the site and displays information on request in the console, tell me what to do to put the program in the interface on PyQt5?
PyQt5 interface
The program itself.
from selenium import webdriver
import time
from art import tprint
from selenium.webdriver.chrome import options
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
while True:
options = Options()
options.headless = True
url = "https://cerberus.vetrf.ru/cerberus/actualObject/pub/actualInfo/"
# driver = webdriver.Chrome()
driver = webdriver.Chrome(chrome_options=options)
guid = str (input('Введите GUID:'))
options = Options()
options.headless = True
url = "https://cerberus.vetrf.ru/cerberus/actualObject/pub/actualInfo/"
try:
driver.get(url=url)
driver.find_element_by_tag_name('input').send_keys(guid)
driver.find_element_by_tag_name('button').click()
print('Запрос выполняется...')
time.sleep(0.5)
# print ('stage1')
if driver.find_elements_by_xpath('//span[@class="label label-success"][1]'):
if True:
tes1 = tprint('Success')
elif driver.find_elements_by_xpath('//span[@class="label label-warning"][1]'):
if True:
tes = tprint('Non success')
elif driver. find_elements_by_tag_name("tbody"):
if True:
tes = tprint('ERROR')
except Exception as ex:
print(ex)
finally:
driver.close()
driver.quit()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question