var price = "2 руб.";
<div class="wrap">
<div class="price">2 руб.</div>
<div class="price">3 руб.</div>
<div class="price">4 руб.</div>
</div>
const elem = Array
.from(document.querySelectorAll('.wrap .price'))
.find(n => n.textContent === price);
if (elem) {
...
const elems = Array.prototype.filter.call(
document.querySelectorAll('.wrap .price'),
n => n.innerText.includes(price)
);
if (elems.length) {
...