You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
output: TypeError: Cannot read properties of null (reading 'id')
How does similar code behave in browsers?
(Link to a jsbin or similar strongly suggested.)
If I open the url: https://todayjackpotresult.com in chrome 119.0.6045.159 in the console input console.log(window.document.querySelector('iframe[id^=google_ads_iframe_]').id)
the output is google_ads_iframe_/22994204070/Articlead_0
Any idea how to make jsdom like that in chrome?
The text was updated successfully, but these errors were encountered:
Basic info:
Minimal reproduction case
import jsdom from 'jsdom'
const virtualConsole = new jsdom.VirtualConsole()
const userAgent = await jsdom.JSDOM.fromURL('https://www.whatismybrowser.com/guides/the-latest-user-agent/chrome', {virtualConsole}).then(_ => _.window.document.evaluate('//span[@Class="code" and contains(text(), "Linux x86_64")]/text()', _.window.document, null, 2, null).stringValue)
const resources = new jsdom.ResourceLoader({userAgent})
const window = await jsdom.JSDOM.fromURL('https://todayjackpotresult.com', {virtualConsole, runScripts:'dangerously', resources, pretendToBeVisual:true}).then(_ => .window)
console.log(window.document.querySelector('iframe[id^=google_ads_iframe]').id)
output: TypeError: Cannot read properties of null (reading 'id')
How does similar code behave in browsers?
(Link to a jsbin or similar strongly suggested.)
If I open the url: https://todayjackpotresult.com in chrome 119.0.6045.159 in the console input console.log(window.document.querySelector('iframe[id^=google_ads_iframe_]').id)
the output is google_ads_iframe_/22994204070/Articlead_0
Any idea how to make jsdom like that in chrome?
The text was updated successfully, but these errors were encountered: