I'm getting starting with Selenium and I'm trying to locate the Next button on the cnn site and if it isn't the last page to click on it, otherwise to end the program.
The html code for enabled button is:
<div class="pagination-arrow pagination-arrow-right cnnSearchPageLink text-active">
"Next"
<i class="icon icon--arrow-right"></i>
</div>
The html code for disabled button is:
<div class="pagination-arrow pagination-arrow-right text-deactive">
"Next"
<i class="icon icon--arrow-right"></i>
</div>
How should approach the solution? I tried is_enabled() or to find part of text in class name but didn't succeed. What should I do?