I am building a Chrome extension that requires a button to be positioned right below the text of the tweet. Since this would require knowing the selector for the
<div> tag which contains the tweet, I tried to search for a common selector for the tweets. Unfortunately, I found out that Twitter changes the class name of that all the
<div> tags each time the website updates and I couldn’t find any other unique selector to access it such as ID. The parent and sibling elements also had dynamic class names. I tried using the DOM path as a selector but that doesn’t work for all tweets and sometimes, it returns null.
For example, I want to add the button below the text and above the image.
I would appreciate if someone could help me out in finding the appropriate selector for all tweets.