public static Element searchElementByIndex(Elements eles, HtmlElementSingle detail, boolean throwException) {
		int index = detail.getIndex();
		if (index >= 0) {
			if (eles.size() <= index) {
				if (throwException) {
					throw new ArrayIndexOutOfBoundsException(detail.getExpression() + " error at " + index);
				} else {
					return null;
				}
			}

			return eles.get(index);
		} else {
			return eles.get(0);
		}
	}