DEV Community

Discussion on: 1 to 50 - MAN VS SELENIUM

Collapse
 
ycmjason profile image
YCM Jason

There is no need to use selenium. Just some simple javascript in the console will do.

(async () => {
  const getValidBoxes = () => [...document.querySelectorAll("#grid > div")].filter(d => d.style.opacity === '1')
  while (getValidBoxes().length > 0) {
    getValidBoxes().forEach(d => d.dispatchEvent(new Event('tap')))
    await new Promise(res => requestIdleCallback(res))
  }
})()

Imgur