Guest User

Untitled

a guest
May 12th, 2020
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1. import com.gargoylesoftware.htmlunit.WebClient;
  2. import com.gargoylesoftware.htmlunit.html.HtmlPage;
  3. import java.io.IOException;
  4.  
  5. public class Main {
  6.     public static void main(String[] args) throws IOException {
  7.         WebClient webClient = new WebClient();
  8.         webClient.getOptions().setJavaScriptEnabled(true);
  9.         webClient.getOptions().setThrowExceptionOnScriptError(false);
  10.         HtmlPage page = webClient.getPage("https://girlsreleased.com");
  11.         webClient.waitForBackgroundJavaScript(5000);
  12.         webClient.getOptions().setThrowExceptionOnScriptError(true);
  13.         System.out.println(page.asXml());
  14.     }
  15. }
Add Comment
Please, Sign In to add comment