mirror of https://git.sr.ht/~hrbrmstr/htmlunit
boB Rudis
4 years ago
42 changed files with 178 additions and 153 deletions
Binary file not shown.
@ -1,18 +1,14 @@ |
|||
.PHONY: clean pkg deps run |
|||
|
|||
pkg: |
|||
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home |
|||
mvn --quiet package |
|||
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home mvn --quiet package |
|||
cp target/htmlunit-1.0-SNAPSHOT.jar ../../inst/java |
|||
|
|||
clean: |
|||
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home |
|||
mvn clean |
|||
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home mvn clean |
|||
|
|||
deps: |
|||
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home |
|||
mvn dependency:copy-dependencies -DoutputDirectory=deps |
|||
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home mvn dependency:copy-dependencies -DoutputDirectory=deps |
|||
|
|||
new: |
|||
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home |
|||
mvn archetype:generate -DgroupId=is.rud.htmlunit -DartifactId=htmlunit -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false |
|||
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home mvn archetype:generate -DgroupId=is.rud.htmlunit -DartifactId=htmlunit -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false |
|||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,39 +0,0 @@ |
|||
package is.rud.htmlunit; |
|||
|
|||
import com.gargoylesoftware.htmlunit.*; |
|||
import com.gargoylesoftware.htmlunit.util.*; |
|||
import java.util.*; |
|||
import java.lang.*; |
|||
import java.io.*; |
|||
|
|||
public class App { |
|||
|
|||
public static List<WebResponse> getRequestsFor(String url, long jsDelay) throws IOException { |
|||
|
|||
final WebClient webClient = new WebClient(BrowserVersion.CHROME); |
|||
|
|||
WebClientOptions wco = webClient.getOptions(); |
|||
wco.setThrowExceptionOnScriptError(false); |
|||
wco.setCssEnabled(true); |
|||
wco.setDownloadImages(true); |
|||
wco.setTimeout(30000); |
|||
|
|||
final List<WebResponse> list = new ArrayList<>(); |
|||
|
|||
new WebConnectionWrapper(webClient) { |
|||
@Override |
|||
public WebResponse getResponse(final WebRequest request) throws IOException { |
|||
final WebResponse response = super.getResponse(request); |
|||
list.add(response); |
|||
return response; |
|||
} |
|||
}; |
|||
|
|||
webClient.getPage(url); |
|||
webClient.waitForBackgroundJavaScript(jsDelay); |
|||
|
|||
return(list); |
|||
|
|||
} |
|||
|
|||
} |
@ -0,0 +1,40 @@ |
|||
package is.rud.htmlunit; |
|||
|
|||
import com.gargoylesoftware.htmlunit.*; |
|||
import com.gargoylesoftware.htmlunit.util.*; |
|||
import java.util.*; |
|||
import java.lang.*; |
|||
import java.io.*; |
|||
|
|||
public class Zapp { |
|||
|
|||
public static List<WebResponse> getRequestsFor(String url, long jsDelay) throws IOException { |
|||
|
|||
final WebClient webClient = new WebClient(BrowserVersion.CHROME); |
|||
|
|||
WebClientOptions wco = webClient.getOptions(); |
|||
wco.setThrowExceptionOnScriptError(false); |
|||
wco.setCssEnabled(true); |
|||
wco.setDownloadImages(true); |
|||
wco.setTimeout(30000); |
|||
|
|||
final List<WebResponse> list = new ArrayList<>(); |
|||
|
|||
new WebConnectionWrapper(webClient) { |
|||
@Override |
|||
public WebResponse getResponse(final WebRequest request) throws IOException { |
|||
final WebResponse response = super.getResponse(request); |
|||
list.add(response); |
|||
return response; |
|||
} |
|||
}; |
|||
|
|||
webClient.getPage(url); |
|||
webClient.waitForBackgroundJavaScript(jsDelay); |
|||
|
|||
return(list); |
|||
|
|||
} |
|||
|
|||
} |
|||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,5 +1,5 @@ |
|||
#Generated by Maven |
|||
#Mon Apr 29 10:10:01 EDT 2019 |
|||
version=1.0-SNAPSHOT |
|||
#Tue Mar 10 08:03:25 EDT 2020 |
|||
groupId=is.rud.htmlunit |
|||
artifactId=htmlunit |
|||
version=1.0-SNAPSHOT |
|||
|
@ -1,2 +1,4 @@ |
|||
is/rud/htmlunit/App$1.class |
|||
is/rud/htmlunit/Zapp.class |
|||
is/rud/htmlunit/App.class |
|||
is/rud/htmlunit/Zapp$1.class |
|||
|
@ -1 +1,2 @@ |
|||
/Users/hrbrmstr/packages/htmlunit/java/htmlunit/src/main/java/is/rud/htmlunit/App.java |
|||
/Users/hrbrmstr/packages/htmlunit/java/htmlunit/src/main/java/is/rud/htmlunit/Zapp.java |
|||
|
@ -1 +0,0 @@ |
|||
/Users/hrbrmstr/packages/htmlunit/java/htmlunit/src/test/java/is/rud/htmlunit/AppTest.java |
Loading…
Reference in new issue