0

I am trying to click on page two using JS

https://www.abbreviations.com/sr

So I opened the console and put

document.getElementsByClassName('rc5')[1].click();

But it didn't click it and go to that page

2 Answers 2

1

This worked for me:

document.querySelectorAll(".pager > .rc5")[1].click()
Sign up to request clarification or add additional context in comments.

Comments

0

what kind action you want to get as your 'click' result? first, it may be important to determine, that browser defines clicks as 'native' and 'generated by the code' and in the case of security and browsers policies.

but there is one smart method to work with DOM - headless browsers, like puppeteer.

you can do really anything with the webpage, using pure javascript.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.