HtmlParser extends AbstractEncodingDetectorParser { @Field public void setExtractScripts(boolean extractScripts) { this.extractScripts = extractScripts; } HtmlParser();  HtmlParser(EncodingDetector encodingDetector); Set<MediaType> getSupportedTypes(ParseContext context); void parse(
            InputStream stream, ContentHandler handler,
            Metadata metadata, ParseContext context); String mapSafeAttribute(String elementName, String attributeName); @Field void setExtractScripts(boolean extractScripts); boolean getExtractScripts();  }
@Test public void testExtractScript() throws Exception { HtmlParser p = new HtmlParser(); p.setExtractScripts(true); List<Metadata> metadataList = getRecursiveMetadata("testHTMLGoodScript.html", p, BasicContentHandlerFactory.HANDLER_TYPE.TEXT); assertEquals(2, metadataList.size()); assertEquals("MACRO", metadataList.get(1).get(TikaCoreProperties.EMBEDDED_RESOURCE_TYPE)); assertContains("cool", metadataList.get(1).get(AbstractRecursiveParserWrapperHandler.TIKA_CONTENT)); assertNotContained("cool", metadataList.get(0).get(AbstractRecursiveParserWrapperHandler.TIKA_CONTENT)); }