Код: Выделить всё
page.get_by_role("treeitem", name="reports-development").locator("div").first.click()
# page.get_by_text(re.compile("Hello team , here is a new report task:")).hover()
text_pattern = re.compile(r"Hello team , here is a new report task:")
elements = page.locator(f'text="{text_pattern.pattern}"')
print(elements.all_inner_texts())
# count = elements.count()
# for i in range(count):
# elements.nth(i).hover()
# page.get_by_label("Add reaction…").click()
# page.get_by_role("gridcell", name="+1 emoji").click()
# page.wait_for_timeout(5000) # Wait for 5 seconds
Как я могу просмотреть найденные сообщения? На экране будет несколько сообщений, поэтому мне придется выполнять действие одно за другим для каждого найденного сообщения.
Подробнее здесь: https://stackoverflow.com/questions/784 ... ext-method
Мобильная версия