Last active
June 24, 2022 06:34
-
-
Save KunoiSayami/388a62347847a8cead67a3b97e9fa9da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// License by: AGPL-3.0 | |
let buttonText = 'Show more'; | |
let loadTimeOut = 1000; | |
document.getElementsByClassName('saleitembrowser_SaleItemBrowserHeader_26iQ9 Panel Focusable')[0].scrollIntoView(); | |
function findButton() { | |
Array.from(document.getElementsByClassName('Focusable')).forEach(element => { | |
if (element.textContent !== undefined && element.textContent == buttonText) { | |
element.click(); | |
console.log('clicked'); | |
} | |
}); | |
let founded = false; | |
for (element of document.getElementsByClassName('salepreviewwidgets_StoreSalePriceBox_Wh0L8')) { | |
if (element.textContent !== undefined && element.textContent === 'TH.4X') { | |
founded = true; | |
element.scrollIntoView(); | |
alert('Founded'); | |
} | |
} | |
if (!founded) { | |
setTimeout(findButton, loadTimeOut); | |
} | |
} | |
findButton(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment