-
-
Notifications
You must be signed in to change notification settings - Fork 185
Closed
Description
The dependency version that I'm using is
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.5.2</version>
<scope>test</scope>
</dependency>
The code that I have is:
try (WebClient webClient = new WebClient()) {
webClient.getOptions().setThrowExceptionOnScriptError(false);
HtmlPage htmlPage = webClient.getPage("https://www.exito.com/");
DomNode domNode = htmlPage.querySelector(".menu-categoria");
System.out.println(domNode); // domNode should not be null
}
After some tests, I realize that the problem is when the page is loading an external JavaScript in the URL https://cdn.polyfill.io/v3/polyfill.min.js?features=Object.keys&flags=gated,always
The problem is because of the JavaScript has in the first line a comment and space in the third character

When I debug into the code the JavaScript sourceCode only has the first three characters

And this is because the content is reading with BOMInputStream

Metadata
Metadata
Assignees
Labels
No labels