Java HTML Jsoup Element getUserId(Element authorElement)

Here you can find the source of getUserId(Element authorElement)

Description

get User Id

License

Open Source License

Parameter

Parameter Description
authorElement a parameter

Return

Google citation user id

Declaration

private static String getUserId(Element authorElement) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import org.jsoup.nodes.Element;

public class Main {
    /** The Constant USER_URL_START_INDEX. */
    private static final int USER_URL_START_INDEX = 16;
    /** The Constant USER_URL_END_INDEX. */
    private static final int USER_URL_END_INDEX = 28;

    /**/*from  www.j  av  a 2 s.c  o  m*/
     *
     * @param authorElement
     * @return Google citation user id
     */
    private static String getUserId(Element authorElement) {

        String userIdUrL = authorElement.attr("href");
        String userId = userIdUrL.substring(userIdUrL.indexOf("/citations?user=") + USER_URL_START_INDEX,
                userIdUrL.indexOf("/citations?user=") + USER_URL_END_INDEX);

        return userId;

    }
}

Related

  1. getTextFromAClass(Element doc, String location)
  2. getTextFromMultipleSelect(Element doc, String location, String locationValue)
  3. getTextFromNodeIfAvailable(Element doc)
  4. getTextFromNodeSelect(Element doc, String location, String locationValue)
  5. getTitle(Element el, String[] titles)
  6. isChildOf(Element child, Elements possibleParents)
  7. isEmptyElement(Node node)
  8. markAll(Elements tags)
  9. markChildren(Element tag, final String color)