Assume you are annoyed by my posts and want to hide all my comments from Stack Overflow. I know how to create a custom CSS to hide my username:
a[href$="what"] {
display:none !important;
}
Unfortunately CSS does not allow me to refer to the parent element, so this will leave the text of the comment.
How can I hide the parent or preceding sibling to that link tag?
I'm not asking for a CSS selector! I know it doesn't exist. Please read the question before closing (and before providing answers that tell me what I already mentioned in my question).
I'm asking how you can select a DOM element in the absence of a relevant CSS selector. I believe there are JS solutions, but I can get none of them to work. Maybe there are other options, therefore I'm not asking for JS specifically. If you tell me how to parse the page with PHP and display it through another domain, that's completely fine with me.
Hints that Greasemonkey might do this are not helpful at all. Explain how to do it. Get it to work on your machine and post a detailed explanation. I couldn't get any of the available scripts to work.