htmlunit

HTMLUnit and Java: NoSuchMethodException: createDefaultSSLContext()

ε祈祈猫儿з 提交于 2019-12-25 16:47:23
问题 I have this HTMLUnit project and every time I try to build it it gives the following error: Exception in thread "main" java.lang.RuntimeException: java.lang.NoSuchMethodException: org.apache.http.conn.ssl.SSLSocketFactory.createDefaultSSLContext() . I tried to search for a solution but the proposed approaches don't look right to me. The JVM I'm using is Java SE 6 (MacOS X Default) and even changing the compiler level from 1.6 to 1.7 or 1.5 doesn't solve the problem. I'm 100% sure the program

When using HtmlUnit, how can I configure the underlying NekoHtml parser?

戏子无情 提交于 2019-12-25 05:22:46
问题 I'm using HtmlUnit to try and scrape a webpage because of it's Javascript support. (I'd rather use Jsoup, but no JS support). The issue relates to a feature of the underlying NekoHtml parser: "http://cyberneko.org/html/features/scanner/allow-selfclosing-iframe" See: http://nekohtml.sourceforge.net/settings.html This can apparently be enabled in Neko, but I'm using HtmlUnit. Is there a way to configure the underlying Neko parser that HTML unit is using to enable this feature? When attempting

When using HtmlUnit, how can I configure the underlying NekoHtml parser?

旧城冷巷雨未停 提交于 2019-12-25 05:22:20
问题 I'm using HtmlUnit to try and scrape a webpage because of it's Javascript support. (I'd rather use Jsoup, but no JS support). The issue relates to a feature of the underlying NekoHtml parser: "http://cyberneko.org/html/features/scanner/allow-selfclosing-iframe" See: http://nekohtml.sourceforge.net/settings.html This can apparently be enabled in Neko, but I'm using HtmlUnit. Is there a way to configure the underlying Neko parser that HTML unit is using to enable this feature? When attempting

Faster page processing with HtmlUnit

让人想犯罪 __ 提交于 2019-12-25 04:51:29
问题 So far I have a working code that use HtmlUnit to get a page asXML However, I find it that, it is processing everything on the page including shockwave flash objects. Which makes the processing slow. I just need it to process, the plain HTML and Javascript, so that it will be faster. This is my code: HtmlPage page = webClient.getPage(sb.toString()); webClient.getJavaScriptEngine().pumpEventLoop(PUMP_TIME); pageString = page.asXml(); page.asXml() is quite slow, maybe because of the points I

How can i find an element by xpath text() and the second cousin of this element?

99封情书 提交于 2019-12-25 03:40:21
问题 I use Htmlunit in java. I need to find an element by text(), and i need the second cousin of this element (i think). I tried this: HtmlElement element = page.getFirstByXPath("//*[text() = \"SOMETHING\"]/parent/following-sibling/child"); System.out.println(element.asText()); // it's null Update: The html source page: <tr> <script> _l('its not important') </script> <td valign="top"> <font class="its not important"> </td> <td valign="top"> <font class="its not important"> SOMETHING <script> _l(

No X509TrustManager implementation available htmlunit

怎甘沉沦 提交于 2019-12-25 03:24:44
问题 For some reason my code with everything imported correctly, using Htmlunit causes an error. package htmlunittesting; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlAnchor; import com.gargoylesoftware.htmlunit.html.HtmlDivision; import com.gargoylesoftware.htmlunit.html.HtmlPage; public class httpunittest { public static void main(String[] args) throws Exception{ final WebClient webClient = new WebClient(); final HtmlPage page = webClient.getPage(

htmlunit 404 error for scripts within page

一笑奈何 提交于 2019-12-25 03:21:05
问题 i am using htmlunit to try to open a site but I keep getting 404 errors. The site works in my python scripts and in my browser but not in html unit for some reason. I think my URL itself is fine but it seems to be opening another site within the site and failing (example.com/SharedResources/Default/js/coda_bubble/jquery.codabubble.js) For anyone familiar with htmlunit, is there any way to get it not to automatically load these other areas of the site? or more gracefully handle errors on the

use Htmlunit, doesn't work button click();

╄→гoц情女王★ 提交于 2019-12-24 23:26:05
问题 Hi all :) I'm new in HtmlUnit (Java). It's my first time to use HtmlUnit stuffs. I'm having some issues to log-in to a web page. And some part of the source of the web site is below. <table> <tr> <td colspan="2"> <div class="AlignRight"> <div class="Button" id="loginButton"> <div class="Left"> </div> <div class="Middle"><a href="javascript:submitForm(document.getElementById('localLogin'), 'submit');"><strong>log-in</strong></a></div> <div class="Right"> </div> </div> </div> </td> </tr> <

htmlunit javascript question

那年仲夏 提交于 2019-12-24 16:05:01
问题 looked through the 'net, as well as other replies on here.. i've got something that looks like the following html: var langId = '-1'; var demoKey = 'null'; var extraParams = 'null'; // only used for User Registration page var multiSelect = false; and function onCampusSelect_USA() { if($('campusUSAIdSelect').value == ''){clearAJAXTimer();hideLayer("programUSADiv"); hideLayer("errorDiv"); hideLayer("buttonDivUS"); return; } // REMOVE THIS LATER clearAJAXTimer(); getData(buildParms('PROGRAMSUS',

Login to gmail using HtmlUnit

∥☆過路亽.° 提交于 2019-12-24 11:07:05
问题 I am trying automate login to gmail but its not working. I am using HtmlUnit for form,textbox and submit button access. On passing correct username and password it displays all the services but in the end when i open gmail it shows the login page. This is my code final WebClient webClient = new WebClient(BrowserVersion.CHROME); // Get the first page webClient.getOptions().setJavaScriptEnabled(true); webClient.getCookieManager().setCookiesEnabled(true); webClient.getOptions().setCssEnabled