private void addRequestIfValid(String url, long priority) {
        if (StringUtils.isBlank(url) || url.equals("#") || url.startsWith("javascript:")) {
            return;
        }

        String canonicalizedUrl = UrlUtils.canonicalizeUrl(url, this.url.toString());
        Request req = new Request(canonicalizedUrl);
        if(priority > 0) {
            req.setPriority(priority);
        }
        targetRequests.add(req);
    }
Helper method to add a request if it's valid.

@param url      URL to add
@param priority Priority for the URL
webmagic-core/src/main/java/us/codecraft/webmagic/Page.java