htmlunit

HtmlUnit can't get the js / ajax added of IFRAME

匿名 (未验证) 提交于 2019-12-03 08:50:26
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've just started learning htmlunit by gargoylesoftware and I have a problem. There is an iframe on a page, which appears after a button click. When i try to get this iframe by name I get a ElementNotFoundException . Also I tried page.getFrames() and it returns frames, but there is no frame that i'm looking for or it is blank. So It looks like js/ajax didn't update it. I work on jcpenny(dot)com and problem appears when I try to "checkout" from "My Bag" page Here is my WebClient settings BrowserVersion bv = BrowserVersion.CHROME_16; bv

HtmlUnit ScriptException errors

匿名 (未验证) 提交于 2019-12-03 08:28:06
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using HtmlUnitDriver,& here is my code. HtmlUnitDriver driver = new HtmlUnitDriver(true); driver.get("some url here"); I am getting following Exception: Caused by: com.gargoylesoftware.htmlunit.ScriptException: Wrapped com.gargoylesoftware.htmlunit.ScriptException: SyntaxError: missing ; before statement (http://sales.liveperson.net/hcp/html/mTag.js?site=7824460#1(eval)#1) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:595) at net.sourceforge.htmlunit.corejs.javascript

Alternative to HtmlUnit

给你一囗甜甜゛ 提交于 2019-12-03 04:55:57
问题 I have been researching about the headless browsers available till to date and found HtmlUnit being used pretty extensively. Do we have any alternative to HtmlUnit with possible advantage compared to HtmlUnit? Thanks Nayn 回答1: As far as I know, HtmlUnit` is the most powerful headless browser. What are you issues with it? 回答2: There are many other libraries that you can use for this. If you need to scrape xml base data use JTidy. If you need to scrape specific data from HTML you can use Jsoup.

Are Futures executed on a single thread? (Scala)

余生长醉 提交于 2019-12-03 03:49:32
Using the default implicit execution context in Scala, will each new future be computed on a single, dedicated thread or will the computation be divided up and distributed to multiple threads in the thread pool? I don't know if this helps, the background to this question is that I want to perform multiple concurrent operations using the HtmlUnit API. To do this, I would wrap each new WebClient instance in a Future. The only problem is that the WebClient class is not thread safe, so I'm worried that it might broken up and sent to different threads. dk14 One future is executed on a single thread

htmlunit: return a completely loaded page

萝らか妹 提交于 2019-12-03 03:32:12
I am using HtmlUnit library for Java to manipulate websites programmatically. I can't find the working solution to my problem: How to determine that all AJAX calls are finished and return a completely loaded webpage? Here's what I have tried: Firstly I create WebClient instance and make call to my method processWebPage(String url, WebClient webClient) WebClient webClient = null; try { webClient = new WebClient(BrowserVersion.FIREFOX_3_6); webClient.setThrowExceptionOnScriptError(false); webClient.setThrowExceptionOnFailingStatusCode(false); webClient.setJavaScriptEnabled(true); webClient

webdriver API: how to disable verbose error messages?

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Running the example source at http://code.google.com/p/selenium/wiki/GettingStarted It runs successfully, however Eclipse throws bunch of WARNING messages. How Can I disable this from displaying ? All I really need is the last line Page title is: Cheese! - Google Search 17 - Aug - 2010 12 : 07 : 00 AM com . gargoylesoftware . htmlunit . util . StringUtils parseHttpDate WARNING : Unable to parse date : - 1 17 - Aug - 2010 12 : 07 : 00 AM com . gargoylesoftware . htmlunit . util . StringUtils parseHttpDate WARNING : Unable to parse

Apache HttpClient 4 And JavaScript

匿名 (未验证) 提交于 2019-12-03 01:54:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I Use Apache HttpClient to Access a webpage . i want to click on a link but the link is javaScript , how can i process click on a javascript link and follow url redirection ? sample javascript and html code : link function send ( content_id , fic , cgRate ) { var params = new Hash (); params . set ( 'content_id' , content_id ); params . set ( 'tool' , fic ); params . set ( 'cgRate' , cgRate ); new Ajax . Updater ( 'return' , '/mypkg/tools' , { method : 'post' , parameters : params , evalScripts : true , onInitialize : new Effect .

Java socketRead0 Issue

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm developing a web cralwer with htmlunit and I have added all required timeout but I notice that the app hangs when the server of some website been crawled is not responding at when I use the Java VisualVM to do a thread dump: java.lang.Thread.State: RUNNABLE at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:129) at java.net.SocksSocketImpl.readSocksReply(SocksSocketImpl.java:88) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:429) at java.net.Socket.connect(Socket

How to setup HtmlUnit in an Eclipse project?

匿名 (未验证) 提交于 2019-12-03 01:44:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My project includes htmlunit jars and downloads some pages content. Executable jar (which includes libs, funct. of eclipse export) thereof, however, works only on the machine on which I created it (on different it doesn't execute). EDIT: It doesn't execute as it doesn't show "Starting Headless Browser" MessageBox upon startup. I used Eclipse Indigo: File > Export > Runnable jar > package required libratries into generated jar Help, gods: import java.io.*; import com.gargoylesoftware.htmlunit.BrowserVersion; import com.gargoylesoftware

Login to LinkedIn using HtmlUnit and navigate to Connections Web page

匿名 (未验证) 提交于 2019-12-03 01:36:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Currently I am trying to login to LinkedIn using HtmlUnit 2.20. But I am not able to login. Below is my code. public static void Login ( String username , String password ) { final WebClient webClient = new WebClient ( BrowserVersion . CHROME ); try { final HtmlPage page = webClient . getPage "https://www.linkedin.com/secure/login" ); final HtmlForm form = page . getForms (). get ( 0 ); final HtmlSubmitInput button = form . getInputByName ( "signin" ); final HtmlTextInput emailBtn = form . getInputByName ( "session_key" ); final