/** * Creates a new named node map for the specified node. * * @param node the owning node */ public XMLDOMNamedNodeMap(final DomNode node) { setParentScope(node.getScriptableObject()); setPrototype(getPrototype(getClass())); attributes_ = node.getAttributes(); setDomNode(node, false); }
/** * Creates a new named node map for the specified node. * * @param node the owning node */ public XMLDOMNamedNodeMap(final DomNode node) { setParentScope(node.getScriptableObject()); setPrototype(getPrototype(getClass())); attributes_ = node.getAttributes(); setDomNode(node, false); }
final NamedNodeMap attributesMap = node.getAttributes(); for (int i = 0; i < attributesMap.getLength(); i++) { final DomAttr attrib = (DomAttr) attributesMap.item(i);
final NamedNodeMap attributesMap = node.getAttributes(); for (int i = 0; i < attributesMap.getLength(); i++) { final DomAttr attrib = (DomAttr) attributesMap.item(i);
final NamedNodeMap attributesMap = node.getAttributes(); for (int i = 0; i < attributesMap.getLength(); i++) { final DomAttr attrib = (DomAttr) attributesMap.item(i);
final NamedNodeMap attributesMap = node.getAttributes(); for (int i = 0; i < attributesMap.getLength(); i++) { final DomAttr attrib = (DomAttr) attributesMap.item(i);
final NamedNodeMap attributesMap = node.getAttributes(); for (int i = 0; i < attributesMap.getLength(); i++) { final DomAttr attrib = (DomAttr) attributesMap.item(i);
final NamedNodeMap attributesMap = node.getAttributes(); for (int i = 0; i < attributesMap.getLength(); i++) { final DomAttr attrib = (DomAttr) attributesMap.item(i);
/** * {@inheritDoc} */ @Override public String getDefaultValue(final Class<?> hint) { if (getPrototype() == null) { return (String) super.getDefaultValue(hint); } final DomNode node = getDomNodeOrNull(); if (node != null) { final DomAttr attr = (DomAttr) node.getAttributes().getNamedItem(attributeName_); if (attr != null) { String value = attr.getValue(); if (getBrowserVersion().hasFeature(JS_DOMTOKENLIST_REMOVE_WHITESPACE_CHARS_ON_EDIT)) { value = String.join(" ", StringUtils.split(value, whitespaceChars())); } return value; } } return ""; }
final NamedNodeMap attributesMap = node.getAttributes(); for (int i = 0; i < attributesMap.getLength(); i++) { final DomAttr attrib = (DomAttr) attributesMap.item(i);
/** * {@inheritDoc} */ @Override public String getDefaultValue(final Class<?> hint) { if (getPrototype() == null) { return (String) super.getDefaultValue(hint); } final DomNode node = getDomNodeOrNull(); if (node != null) { final DomAttr attr = (DomAttr) node.getAttributes().getNamedItem(attributeName_); if (attr != null) { String value = attr.getValue(); if (getBrowserVersion().hasFeature(JS_DOMTOKENLIST_REMOVE_WHITESPACE_CHARS_ON_EDIT)) { value = String.join(" ", StringUtils.split(value, whitespaceChars())); } return value; } } return ""; }
private void Login() throws FailingHttpStatusCodeException, MalformedURLException, IOException { WebClient client = new WebClient(); client.setJavaScriptEnabled(false); HtmlPage page = client.getPage("http://svergja.com/forum/"); HtmlForm form = (HtmlForm) page.getElementById("navbar_loginform"); HtmlTextInput username = (HtmlTextInput) page.getElementById("navbar_username"); username.setValueAttribute("stackoverflow"); HtmlPasswordInput password = (HtmlPasswordInput) page.getElementById("navbar_password"); password.setValueAttribute("stackit123"); HtmlSubmitInput button = form.getInputByValue("Log in"); page = button.click(); List<HtmlAnchor> anchorList = page.getAnchors(); for (HtmlAnchor htmlAnchor : anchorList) { if(htmlAnchor.getAttribute("href").contains("member.php?")) { page = htmlAnchor.click(); } } HtmlSpan span = (HtmlSpan) page.getElementById("userinfo"); DomNodeList<DomNode> nodeList = span.getChildNodes(); for (DomNode domNode : nodeList) { NamedNodeMap map = domNode.getAttributes(); Node node = map.getNamedItem("class"); if(node != null && node.getNodeValue() != null && node.getNodeValue().equals("usertitle")) { System.out.println("The usergroup is "+domNode.getTextContent()); } } }