Introduction
When trying to scrape some data on a third party website realized that if I used document.querySelector
had different results from what view-source
URI scheme.
Description
The query selector I am using is document.querySelector('script[data-target="react-app.embeddedData"]');
. There is only one script tag matching that query.
When I execute that query the innerText of the script tag displays no results:
However when I use view-source
the results array is not empty:
I already know that the element’s content is dynamic. I executed the querySelector before and after checking the view source and viceversa. In all scenarios view source displays the results as expected but not using querySelector.
Software version
- Google Chrome Versión 125.0.6422.141 (Build oficial) (64 bits)