From: asashour <asa...@ya...> - 2016-06-22 09:04:37
|
Hi, - You may need to wait a little more [1]. - I hope you compare the XPath in both HtmlUnit and real Chrome (using document.evalute [2]) - You can print page.asXml() to see what HtmlUnit sees. - Otherwise, you need to post your complete case, hopefully minimal. Ahmed [1] http://htmlunit.sourceforge.net/faq.html#AJAXDoesNotWork [2] https://developer.mozilla.org/en-US/docs/Introduction_to_using_XPath_in_JavaScript Tristan Janicki wrote > As my title would portray I'm using HtmlUnit to find the elements of > a webpage (in particular a youtube playlist) that are that are quiet deep > within the tree of elements, and whilst this should pose no problem I've > nonetheless been experiencing some inconsistencies between results on one > platform and another, assuming them using the same language/commands > return > the same results. I need to find this section > https://gyazo.com/a22e1d145b32a3194720b6cecb513123, from the > tag down > to the > tag that has both the video name and URL. Using your libraries > in netbeans I fiddled around for a number of hours with exceptionally long > (for an attempt at absolute accuracy within the bounds of my required > modularity) XPath statements ( > https://gyazo.com/f2444e85abd252df43ea95c44b811489) and to no avail. It > seems to get stuck on the > <ul> > element just before the classless, id-less, > unidentifiable > <li> > tag, yet when I assumed this task in the chrome console > it returned all the videos in the playlist with exceptional ease > https://gyazo.com/104e110ee3260d1c7517f5b9a8374efb. > > Now my question(s) is, is the difference in returned values a > products > of my coding, misuse of your product, security feature of youtube (to > prevent this exact sort of thing), or a bug within the libraries? Moreover > how do I go about achieving the same results as the chrome console but in > my Java application? > > Any help is much appreciated, > ~ T.G.J. -- View this message in context: http://htmlunit.10904.n7.nabble.com/HtmlUnit-XPath-vs-Chrome-Console-tp39636p39642.html Sent from the HtmlUnit - General mailing list archive at Nabble.com. |