Search in sources :

Example 1 with ExtractedUrlAnchorPair

use of edu.uci.ics.crawler4j.parser.ExtractedUrlAnchorPair in project crawler4j by yasserg.

the class HtmlContentHandlerTest method testSciptInHead.

@Test
public void testSciptInHead() throws Exception {
    HtmlContentHandler parse = parseHtml("<html><head>" + "<script src=\"/js/app.js\"></script>" + "</head></html>");
    ExtractedUrlAnchorPair script = parse.getOutgoingUrls().get(0);
    assertEquals("/js/app.js", script.getHref());
}
Also used : ExtractedUrlAnchorPair(edu.uci.ics.crawler4j.parser.ExtractedUrlAnchorPair) HtmlContentHandler(edu.uci.ics.crawler4j.parser.HtmlContentHandler) Test(org.junit.Test)

Aggregations

ExtractedUrlAnchorPair (edu.uci.ics.crawler4j.parser.ExtractedUrlAnchorPair)1 HtmlContentHandler (edu.uci.ics.crawler4j.parser.HtmlContentHandler)1 Test (org.junit.Test)1