'Is there any way to detect if the website doesn't allow right mouse click given the website url?

I am building a project. I have a list of website URLs, and I want to know if the website allows the right mouse click or not. For example in this on clicking the right mouse, the website says that the right-click is disabled. Similarly, there may be other websites that use a similar functionality. I want to detect these kinds of websites from their URLs. So far, I have tried this code -

def right_click_disabled(url):
page = verify_url(domain)
if page is None:
    return None

soup = BeautifulSoup(page.content, "html.parser")
html_url = str(soup.find("html"))
out = re.search("event.button==2", html_url)
if out is not None:
    return True
else:
    return False

It searches "event.button == 2" from the website source code, which will only identify if the website has any event assigned to it which is triggered by a right mouse click. In some cases, it won't be able to do that also.

So, I am looking for a solution which can be generalized to all the websites. Thankyou.



Sources

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

Source: Stack Overflow

Solution Source