I have stored a webpage's HTML in the database.
I want to take advantage of HtmlUnit's ability to find/reference DOM elements.
Is it possible to load the HtmlPage object from a string (via ... |
I am using HtmlUnit.
I have an object of HtmlTableRow type, and I want to dump all of the content to a variable, how can I do this?
i.e. just want to get ... |
Instead of automatically following JavaScript redirects, can I force HtmlUnit to return the URL the JavaScript wants to redirect me to?
// context:
If there's 5 JavaScript redirects in a row, I can ... |
WebClient client = new WebClient();
WebRequestSettings wrs = new WebRequestSettings(new URL("http://stackoverflow.com/ping/?what-the-duck?"), HttpMethod.HEAD);
client.getPage(wrs);
Running this code results in throwing FileNotFoundException, because HTTP Status code on the page is 404 and getting the same page ... |
Is it possible to use HtmlUnit through SOCKS proxy? Could anyone please provide a code sample?
====
So I've dug through webclient sources, here's the best way I can think of:
- Subclass
MultiThreadedHttpConnectionManager ... |
I'm using HtmlUnit for a parsing job and I've discovered that the memory gets wasted with the WebClient holding the history for each WebWindow. I don't use the history at all ... |
Having just upgraded to a newer version of HtmlUnit (2.4), I've noticed certain tests are failing when comparing the output of asText. Looking into the differences, this is because dates (present ... |
|
I'm using Htmlunit in my C# project, but I cannot convert this code in java to C#
webClient.setWebConnection(new HttpWebConnection(webClient) {
public WebResponse getResponse(WebRequestSettings settings) throws IOException {
...
|
I'm just getting started with HTMLUnit and what I'm looking to do is take a webpage and extract out the raw text from it minus all the html markup.
Can htmlunit accomplish ... |
I'm a pretty big noob to Java, but I would like try out htmlunit. I'm using netbeans as my IDE and I've created a project folder "hu1". Here is the ... |
I've recently updated from HTMLUnit 2.4 to 2.5 (we'd go for the latest version but there is a lot of code to refactor due to the deprecated APIs). I'm now ... |
What Exception is thrown on connection timeout in HTMLUnit ?
|
I'm trying to use HtmlUnit in Java to log into a website. First i enter the user name then password. After that i need to select an option from a dropdown ... |
Memory is going to increase by each loop cycle. Any idea why is it?
public static void main(String p[]) throws IOException {
WebClient webClient = ...
|
I use htmlunit.
How i can set value of text input if it does not have an attribute 'value' ?
<input type="text" onkeypress="test();" id="id" name="name" class="ttt">
I tried this, but nothing
...
|
I am trying to send some HTTP POST parameters to some web server and one of parameters contains cyrillic characters. So the problem is that if I use this code:
wc.getPage(requestSettings);
requestSettings.setHttpMethod(HttpMethod.POST);
requestSettings.setRequestParameters(new ArrayList());
requestSettings.getRequestParameters().add(new ...
|
What I am trying to do is to use HtmlUnit to get the href from the parent anchor of a span. Here is what I mean.
<a href="http://link.com/serv?id=jibberish&type=dynamic/changeseachvisit"><span>Some Unique Text</span></a>
There ... |
HtmlUnit for Java is great but I haven't been able to figure out how to view the full source or return the source of a web site as a string. can ... |
This question was asked once already, but the API changed I guess and the answers are no valid anymore.
URL url = new URL("http://www.example.com");
StringWebResponse response = new StringWebResponse("<html><head><title>Test</title></head><body></body></html>", url);
HtmlPage page = ...
|
Trying to debug/understand an issue that I'm having with trying to run a test with Htmlunit, running it using Tor with Privoxy as the Http Proxy Server.
I've setup Tor/Privoxy on a ... |
So I've researched everything I can find on this subject, and I cannot for the life of me find a solution. I worked the problem into a small example, seen below. ... |
it seems that HtmlUnit uses it's own centralized ProxyConfig object to set up proxy settings. Is there a way to make it ignore the ProxyConfig and use JVM properties https.proxyHost,https.proxyPort,http.proxyHost and ... |
I've extracted a List of DomNode objects from the HTMLPage object using getByXPath. However, when I try and query a returned DomNode object, again using getByXPath, the results are as if ... |
I wonder if YouTube could be searched with HtmlUnit. I started to write code, here it is:
import java.io.IOException;
import java.net.MalformedURLException;
import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
public class HtmlUnitExampleTestBase {
...
|
I don't understand what's going on ???
I have the following code :
public static void main(String[] args){
WebClient wc = null;
HtmlPage hp = null;
...
|
I have some site with some page. There are a few links with target=_blank on the page with hrefs like this:
javascript:open('somepage.php?lala=lala&lolol=lolol')
So HtmlUnit 2.8 and 2.9 opens it in the new window ... |
I am working on a Java web app with unit tests that deploy the app in Jetty. I use HtmlUnit to hit the app and do some high level tests. I ... |
I'm trying to learn how to use HTMLUnit in order to test some website's JavaScripts elements.
I've tried doing some homework and using the HTMLUnit's How-To's but with no success. I get ... |
Hi, I am planning to use htmlunit for my web test.As per Htmlunit API,it doesn't support chrome browser. Anybody ever tried to test the web application in chrome browser using htmlunit. ... |
Hi, I'm trying to use HtmlUnit to login to my local wordpress website but it seems to have a cookies issue. That's that begining of the code: WebClient webClient = new WebClient(); HtmlPage loginPage = webClient.getPage("http://localhost/flowersWp/wp-admin"); HtmlForm form = loginPage.getFormByName("loginform"); Nov 27, 2010 12:43:35 PM org.apache.http.client.protocol.ResponseProcessCookies processCookies WARNING: Cookie rejected: "[version: 0][name: wordpress_2418eeb845ebfb96f6f1a71ab8c5625a][value: +][domain: localhost][path: /flowersWp/wp-admin][expiry: Fri Nov 27 12:43:35 IST ... |
hello i need to use of " public HtmlElement pressAccessKey(char accessKey) throws IOException" for press desired key on the webpage that read by function "HtmlPage getPage()" in the htmlunit library so for test an learn this function i use this code but not work " form.getInputByName("data[title]").click(); page.setFocusedElement(form.getInputByName("data[title]")) page.pressAccessKey('a'); " while this code work correct " form.getInputByName("data[title]").setValueAttribute(Title); " so i need to ... |
Hi I am using of htmlunit library and Firebug addon for firefox and for example fill textbox in google and click search with this code: public static void main() throws IOException{ WebClient browser; browser = new WebClient(); HtmlPage page; page=(HtmlPage) browser.getPage("www.google.com"); HtmlForm form=page.getFormByName("f"); form.getInputByName("q").setValueAttribute("search topic"); page=(HtmlPage) form.getInputByName("btnG").click(); } but i have problem with componet like component that we write our mail ... |
|
|
|