Search in sources :

Example 31 with Elements

use of org.jsoup.select.Elements in project Asqatasun by Asqatasun.

the class DOMHandlerImpl method getTotalNumberOfElements.

@Override
public int getTotalNumberOfElements() {
    if (totalNumberOfElement == -1) {
        totalNumberOfElement = cssLikeSelectNodeSet("*").getSelectedElementNumber();
        selectedElements = new Elements();
    }
    return totalNumberOfElement;
}
Also used : Elements(org.jsoup.select.Elements)

Example 32 with Elements

use of org.jsoup.select.Elements in project Asqatasun by Asqatasun.

the class TextEmptinessCheckerTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    mockTextElementBuilder = createMock(TextElementBuilder.class);
    mockSSPHandler = createMock(SSPHandler.class);
    elements = new Elements();
    element = new Element(Tag.valueOf("div"), "");
    mockTestSolutionHandler = createMock(TestSolutionHandler.class);
    mockProcessRemarkService = createMock(ProcessRemarkService.class);
}
Also used : TextElementBuilder(org.asqatasun.rules.textbuilder.TextElementBuilder) Element(org.jsoup.nodes.Element) SSPHandler(org.asqatasun.processor.SSPHandler) TestSolutionHandler(org.asqatasun.ruleimplementation.TestSolutionHandler) Elements(org.jsoup.select.Elements) ProcessRemarkService(org.asqatasun.service.ProcessRemarkService)

Example 33 with Elements

use of org.jsoup.select.Elements in project Asqatasun by Asqatasun.

the class CaptchaElementSelector method getSiblingsAndParents.

/**
     * 
     * @param el
     * @return all the parents and the siblings of the element
     */
private Elements getSiblingsAndParents(Element el) {
    Elements siblingsAndParents = new Elements();
    siblingsAndParents.addAll(el.siblingElements());
    siblingsAndParents.addAll(el.parents());
    return siblingsAndParents;
}
Also used : Elements(org.jsoup.select.Elements)

Example 34 with Elements

use of org.jsoup.select.Elements in project Asqatasun by Asqatasun.

the class TextNotIdenticalToAttributeCheckerTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    mockTextElementBuilder = createMock(TextElementBuilder.class);
    mockSSPHandler = createMock(SSPHandler.class);
    elements = new Elements();
    element = new Element(Tag.valueOf("div"), "");
    element.attr(AttributeStore.ALT_ATTR, "test");
    mockTestSolutionHandler = createMock(TestSolutionHandler.class);
    mockProcessRemarkService = createMock(ProcessRemarkService.class);
}
Also used : TextElementBuilder(org.asqatasun.rules.textbuilder.TextElementBuilder) Element(org.jsoup.nodes.Element) SSPHandler(org.asqatasun.processor.SSPHandler) TestSolutionHandler(org.asqatasun.ruleimplementation.TestSolutionHandler) Elements(org.jsoup.select.Elements) ProcessRemarkService(org.asqatasun.service.ProcessRemarkService)

Example 35 with Elements

use of org.jsoup.select.Elements in project Asqatasun by Asqatasun.

the class TextOnlyContainsNonAlphanumericalCharactersCheckerTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    mockTextElementBuilder = createMock(TextElementBuilder.class);
    mockSSPHandler = createMock(SSPHandler.class);
    elements = new Elements();
    element = new Element(Tag.valueOf("div"), "");
    mockTestSolutionHandler = createMock(TestSolutionHandler.class);
    mockProcessRemarkService = createMock(ProcessRemarkService.class);
}
Also used : TextElementBuilder(org.asqatasun.rules.textbuilder.TextElementBuilder) Element(org.jsoup.nodes.Element) SSPHandler(org.asqatasun.processor.SSPHandler) TestSolutionHandler(org.asqatasun.ruleimplementation.TestSolutionHandler) Elements(org.jsoup.select.Elements) ProcessRemarkService(org.asqatasun.service.ProcessRemarkService)

Aggregations

Elements (org.jsoup.select.Elements)218 Element (org.jsoup.nodes.Element)120 Document (org.jsoup.nodes.Document)78 Test (org.junit.Test)60 ArrayList (java.util.ArrayList)51 Configuration (com.vaadin.addon.charts.model.Configuration)27 IOException (java.io.IOException)26 URL (java.net.URL)13 ParseTest (org.jsoup.integration.ParseTest)11 File (java.io.File)9 List (java.util.List)9 HashMap (java.util.HashMap)7 SSPHandler (org.asqatasun.processor.SSPHandler)7 TestSolutionHandler (org.asqatasun.ruleimplementation.TestSolutionHandler)7 ProcessRemarkService (org.asqatasun.service.ProcessRemarkService)7 MalformedURLException (java.net.MalformedURLException)6 Logger (org.slf4j.Logger)6 LoggerFactory (org.slf4j.LoggerFactory)6 PlotOptionsLine (com.vaadin.addon.charts.model.PlotOptionsLine)5 RequestUtil (com.kyj.fx.voeditor.visual.util.RequestUtil)4