我正在尝试获取所有主要链接,然后单击它们并导航到页面:
WebClient client = new WebClient();
HtmlPage page = client.getPage(url);
// Get all links with a href of www.example.com/pages/1_
List<HtmlAnchor> links = (List<HtmlAnchor>) page.getByXPath("//a[href='www.example.com/pages/1_*'");
links[0].click();
调用click后,是否返回一个HtmlPage?(NetBeans文档没有告诉我。)
XPath表达式看起来正常吗?