how to check that an element of a certain class is present on the page?

opsfafsme

Well-Known Member
Rule The Universe
VIP
Joined
Jul 2, 2018
Messages
243
Reaction score
91
Website
OnlinePiercingShop.com
Achievement
continue to answer questions asked in private
suppose you need to check that the link
Code:
<a class="navline">
is present on the page, it can be done like this

JavaScript:
if ( await EvaluateScript("!! document.querySelector('a.navline')") ) {
    // is present
} else {
    // not present
}
 
  • Like
Reactions: wernerk93

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu