org.jsoup.select.Selector.SelectorParseException Java Examples

The following examples show how to use org.jsoup.select.Selector.SelectorParseException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ResourceCheckSteps.java    From vividus with Apache License 2.0 5 votes vote down vote up
private String getSelector(Element element)
{
    try
    {
        return element.cssSelector();
    }
    catch (SelectorParseException exception)
    {
        return "N/A";
    }
}
 
Example #2
Source File: DOMHandlerImpl.java    From Asqatasun with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * http://www.ibm.com/developerworks/library/x-javaxpathapi.html
 *
 * @param expr
 * @return
 */
@Override
public DOMHandler cssLikeSelectNodeSet(String expr) {
    if (StringUtils.isNotBlank(expr)) {
        try {
        selectedElements = jsoupDocument.select(expr);
        } catch (SelectorParseException spe) {               
        } catch (IllegalArgumentException iae) {
        }
    }
    return this;
}