0

Let me start by saying I never used angular and semi-new to javascript. I am using CEFSharp in a project. Most of the code I am using is based of document.getElementsByClassName and document.getElementById. I can get my program to perform the click on elements with no problem.

However, for the first time ever I ran into e2e data on the button. I never heard of e2e before until now.

<button data-e2e="creative.response" data-e2e-variant="negative" width="100%,100%,auto" class="sc-lmoMRL sc-iIEYCM fsMcEt jtcAQi">No thanks</button>

What would be the best solution to tackling this problem?

            var word = 'No thanks', queue = [document.body], curr;
            while (curr = queue.pop()) {
                if (!curr.textContent.match(word)) continue;
                for (var i = 0; i < curr.childNodes.length; ++i) {
                    switch (curr.childNodes[i].nodeType) {
                        case Node.TEXT_NODE: // 3
                            if (curr.childNodes[i].textContent.match(word)) {
                                curr.click();
                            }
                            break;
                        case Node.ELEMENT_NODE: // 1
                            queue.push(curr.childNodes[i]);
                            break;
                    }
                }
            }

I have tried the above, but it is spotty on catching the button.

At least point me in the right direction of what I need to learn to better understand how to identify and click these e2e elements

rmobis
  • 26,129
  • 8
  • 64
  • 65
Spontane
  • 1
  • 1

0 Answers0