0
도움 : 당신이 div 태그에 도달 할 경우자바 네코 HTML, javax.xml.xpath의
org.cyberneko.html.parsers.DOMParser dp = new DOMParser();
dp.parse(new InputSource(new StringReader("<!DOCTYPE html><html><body><div></div></body></html>")));
Document d = dp.getDocument();
XPathFactory xpf = XPathFactory.newInstance();
XPath x = xpf.newXPath();
Node n = (Node)x.evaluate("//div",d,XPathConstants.NODE);
System.out.println(n == null);
n이 null 인 어떤 이유, 감사
? 필자는 org.cyberneko.html.parsers.DOMParser'에 익숙하지 않지만 http://nekohtml.sourceforge.net/faq.html#uppercase는 파서가 이름을 대문자 이름으로 정규화 할 수 있다고 제안합니다. –
와우. 좋은 캐치. 그것은 그것을 해결합니다. –