Package barrysoft.web

Examples of barrysoft.web.Parser.addRule()


   
    ParserRule pr = new ParserRule(parseRule);
    pr.addParam(new ParserRuleParam("city", "Rome"));
    pr.addParam(new ParserRuleParam("country", "Italy"));
   
    p.addRule(pr);
     
    p.parseData(plainData);
   
    String[][] results = p.getRule(0).getResults();
    checkResults(results, 1, new int[] {2});
View Full Code Here


 
  @Test
  public void testParseURL() {
   
    Parser p = new Parser("Time Parser");
    p.addRule(new ParserRule(timeRule));
   
    try {
     
      p.parseData(new WebDownloader(timeURL));
     
View Full Code Here

      prp.addValue(s);
   
    ParserRule pr = new ParserRule(itsaRule, prp);
    pr.setQuickRule(" [series]<");
   
    p.addRule(pr);
   
    try {
     
      WebDownloader wd = new WebDownloader("http://www.italiansubs.net/index.php");
      wd.addFormElement("option", "com_remository");
View Full Code Here

  public void testParserMultipleRules() {
   
    Parser p = new Parser("ITSA Parser Multi");
   
    for (String rule : multipleRules)
      p.addRule(new ParserRule(rule));
   
    try {
     
      WebDownloader wd = new WebDownloader("http://www.italiansubs.net/index.php");
      wd.addFormElement("option", "com_remository");
View Full Code Here

  public void testParserMultipleParamsRules() {
   
    Parser p = new Parser("ITSA Parser Multi");
   
    for (String rule : multipleParamsRules)
      p.addRule(new ParserRule(rule));
   
    ParserRule pr = p.getRule(multipleParamsRules.length-1);
    pr.addParam(new ParserRuleParam("tag", "Inviato il "));
   
    try {
View Full Code Here

      }
     
      pr.setGroupName("group1", 0);
      pr.setGroupName("group2", 1);
     
      p.addRule(pr);
    }
   
    String xmlSource = p.getXML(0);
   
    System.out.println(xmlSource);
View Full Code Here

    Parser p = new Parser("TVSubtitles.net Parser");
    ParserRule rule = new ParserRule(tvstRegex);
    rule.setGroupName("Language", 0);
    rule.setGroupName("Link", 1);
   
    p.addRule(rule);
   
    WebDownloader dl = new WebDownloader();
    try {
      dl.setUrl("http://www.tvsubtitles.net/episode-3079.html");
    } catch (MalformedURLException e) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.