Answer the question
In order to leave comments, you need to log in
How to write a condition: if more than a certain number -> click() in JS?
Hello everyone, please tell me how to get the numerical value 6.31 from the page:
<div class="scale scale--sm js-profile-score" data-score="6.31" data-delimiter="," data-digits-count="2" data-line-width="7" data-size="70" data-style="LIGHT" data-timing="0">
<canvas width="70" height="70" class="scale-display " style="width: 70px; height: 70px;"></canvas>
<b class="scale-value no-dps">6,31</b></div>
document.getElementsByClassName('js-profile-header-vote')[0].click()
window.setInterval(function(){
[].forEach.call(
document.getElementsByClassName('js-profile-header-name')[0].click()); -- жмем кнопку на странице
//////////////
Условие if >6.31, то жмем document.getElementsByClassName('js-profile-header-vote')[0].click()
esle то жмем document.getElementsByClassName('js-profile-header-vote')[1].click()
////////////// Вот в этом моменте немного буксую(
}, 3000);
Answer the question
In order to leave comments, you need to log in
var headers = document.querySelectorAll('.js-profile-header-vote')
if (x > 6.31) {
headers[0].click()
} else {
headers[1].click()
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question