'How can i do an Rightclick with Selenium (Python) on the last send Messages in Discord. Can someone pls tell me also the element value?

Rightclick in Discord Web

I have created a Discord automation that sends messages via selenium. Now it should delete the message again after 5 sec. I wanted to do it with a right click and then to the delete element. But somehow the right click does not work.



Solution 1:[1]

This question was already answered here. Use context_click.

from selenium import webdriver
from selenium.webdriver import ActionChains

driver = webdriver.Chrome()
actionChains = ActionChains(driver)

actionChains.context_click(your_link).perform()

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 JAdel