How can I find this element using Selenium? (I want to find it by the "data-peer-id" thing,)
<a class="row no-wrap row-with-padding row clickable hover-effect chat;ist-chat chatlist0chat-abitbigger" data-peer-id="-1280177577">
How can I find this element using Selenium? (I want to find it by the "data-peer-id" thing,)
<a class="row no-wrap row-with-padding row clickable hover-effect chat;ist-chat chatlist0chat-abitbigger" data-peer-id="-1280177577">
To find the specific element for the telegram channel to forward the message to you would could do something like this:
from selenium.webdriver.common.by import By
driver.find_element(By.CLASS_NAME, 'popup-container').find_element(By.XPATH, '//*[@data-peer-id="-1280177577"]').click()
This is because there are two sets of lists of channels (the sidebar and the new popup) when you originally searched you were getting the first instance (which would be the sidebar for channel selection) while the element that you want is the second instance of it (in the forward popup).
Though if you know the channel names beforehand on who you want to message you could just write the channel in the forward input box
driver.find_element(By.CLASS_NAME, 'popup-container').find_element(By.TAG_NAME, 'input').send_keys('channel_name_here')