Open alucardu opened 6 years ago
it is way to do that.
.evaluate(_ => {
document.querySelector('#target').style.opacity = '0'
})
That returns a
COMMAND | ReferenceError: document is not defined
Code--
var elementExists = document.getElementsByClassName(".searchbarX div .hidden-lower-xl");
chromy
.wait(2500)
.goto(scenario.url)
if (elementExists) {
chromy
.evaluate(_ => {
document.querySelector('.searchbarX div .hidden-lower-xl').style.opacity = '0'
})
}
It looks like it executes the code before the page is loaded.
document
can be accessed in evaluate context only.
does this works?
chromy
.wait(2500)
.goto(scenario.url)
.evaluate(_ => {
var elementExists = document.getElementsByClassName(".searchbarX div .hidden-lower-xl");
if (elementExists) {
document.querySelector('.searchbarX div .hidden-lower-xl').style.opacity = '0'
}
})
.end()
I have certain elements I don't want to show on my screenshots. Any way to hide them using Chromy?