From peter at hexagile.com Sat Jun 11 05:15:01 2011 From: peter at hexagile.com (Peter Szinek) Date: Sat, 11 Jun 2011 11:15:01 +0200 Subject: [Celerity-users] elements_by_xpath fails completely Message-ID: Hey all, I noticed this on more sites lately, can dig up more examples if you want. b = Celerity::Browser.new b.goto "https://careers-hrblock.icims.com/jobs/search" irb(main):012:0* b.elements_by_xpath("//html") => [] irb(main):013:0> b.elements_by_xpath("//body") => [] irb(mai irb(main):005:0> b.elements_by_xpath("//table") => [] yet, irb(main):016:0> b.elements_by_xpath("//*").size => 782 among them html, body, table and other elements. Inspecting b.xml reveals that the HTML looks like as it should... Any idea what's going on? btw. a site from the same portal, with very similar structure (https://jobs-bannerhealth.icims.com/jobs/search) works just fine... Cheers, Peter From jari.bakken at gmail.com Sat Jun 11 07:38:05 2011 From: jari.bakken at gmail.com (Jari Bakken) Date: Sat, 11 Jun 2011 13:38:05 +0200 Subject: [Celerity-users] elements_by_xpath fails completely In-Reply-To: References: Message-ID: On Sat, Jun 11, 2011 at 11:15 AM, Peter Szinek wrote: > Hey all, > > I noticed this on more sites lately, can dig up more examples if you want. > > b = Celerity::Browser.new > b.goto "https://careers-hrblock.icims.com/jobs/search" > irb(main):012:0* b.elements_by_xpath("//html") > => [] > irb(main):013:0> b.elements_by_xpath("//body") > => [] > irb(mai > irb(main):005:0> b.elements_by_xpath("//table") > => [] > Looks like something weird in HtmlUnit's XPath implementation - try asking on their mailing list. Celerity simply calls out to HtmlPage.getByXpath().