Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.gargoylesoftware.htmlunit.WebClient;
- import com.gargoylesoftware.htmlunit.html.HtmlPage;
- import java.io.IOException;
- public class Main {
- public static void main(String[] args) throws IOException {
- WebClient webClient = new WebClient();
- webClient.getOptions().setJavaScriptEnabled(true);
- webClient.getOptions().setThrowExceptionOnScriptError(false);
- HtmlPage page = webClient.getPage("https://girlsreleased.com");
- webClient.waitForBackgroundJavaScript(5000);
- webClient.getOptions().setThrowExceptionOnScriptError(true);
- System.out.println(page.asXml());
- }
- }
Add Comment
Please, Sign In to add comment