Answer the question
In order to leave comments, you need to log in
How to do sequential check?
Good afternoon. Please tell me, I am writing a program to check the data on the site of certain keys. There are a certain number of these keys for verification, my knowledge of programming was enough to simply ask a person through the command line.
guid = str(input('Введите GUID:'))
id_tasks = int(input('Ведите цифры ID задачи:'))
guid
and id_tasks
interconnected. id_tasks
is responsible for sending a comment about the event checked by in my workspace. guid
url = "https://cerberus.vetrf.ru/cerberus/actualObject/pub/actualInfo/"
options = Options()
options.headless = True
try:
guid = str(input('Введите GUID:'))
id_tasks = int(input('Ведите цифры ID задачи:'))
options = Options()
options.headless = True
# driver = webdriver.Chrome()
driver = webdriver.Chrome(chrome_options=options)
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 ('Осталось совсем чуть-чуть...')
if driver.find_elements_by_xpath('//span[@class="label label-success"][1]'):
if True:
request = pyrus.models.requests.TaskCommentRequest(text="Подтверждена", action="")
task = pyrus_client.comment_task(id_tasks, request).task
print('Подтверждена')
elif driver.find_elements_by_xpath('//span[@class="label label-warning"][1]'):
if True:
print('Не подтверждена')
# window2 = Tk()
# window2.title('Не подтверждена')
# window2.geometry('300x250')
# window2.mainloop()
elif driver. find_elements_by_tag_name("tbody"):
if True:
print('Ошибка, площадка не найдена.')
except Exception as ex:
print(ex)
finally:
driver.close()
driver.quit()
Answer the question
In order to leave comments, you need to log in
Do not write a sheet of code, but break the task into components.
First, refactor (remake) your code into a function like this:
def is_guid_accepted(guid: str) -> bool:
#тут код
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question