Package org.ar.domainspecific.tools.webparser

Examples of org.ar.domainspecific.tools.webparser.LocalHtmlRendererContext


   * @throws XPathExpressionException
   */
  public static void main(String[] args) throws MalformedURLException, XPathExpressionException
  {
    UserAgentContext uacontext = new MozillaUserAgent();
    LocalHtmlRendererContext rcontext = new LocalHtmlRendererContext(uacontext);
    //rcontext.navigate("http://www.google.com/search");
   
    FormInput submitInput1 = new FormInput("hl", "en");
    FormInput submitInput2 = new FormInput("q", "student");
    FormInput submitInput3 = new FormInput("aqi", "g7g-s1g2");
   
    URL url = org.lobobrowser.util.Urls.guessURL("http://www.google.com/search");
   
    rcontext.submitForm("GET", url, "_this", null, new FormInput[] {
        submitInput1, submitInput2, submitInput3
    });
   
    HTMLDocumentImpl startingDoc = rcontext.getCurrentDocument();
    if(startingDoc == null)
    {
      throw new IllegalStateException("No document available for startup location.");
    }
   
View Full Code Here


    Logger logger = Logger.getLogger(com.steadystate.css.parser.SACParser.class.getName());
    logger.setLevel(Level.OFF);
    try
    {
      UserAgentContext uacontext = new MozillaUserAgent();
      LocalHtmlRendererContext rcontext = new LocalHtmlRendererContext(uacontext);
     
      conceptName = breakCapitalizedConcepts(conceptName.replace("_", " ")," ");
     
      Logger.getLogger(Processor.class.getName()).info("Google number of results for " + conceptName);
     
      FormInput submitInput1 = new FormInput("hl", "en");
      FormInput submitInput2 = new FormInput("q", conceptName);
      FormInput submitInput3 = new FormInput("aqi", "g7g-s1g2");
     
      URL url = org.lobobrowser.util.Urls.guessURL(SEARCH_STRING);
     
      rcontext.submitForm("GET", url, "_this", null, new FormInput[] {
          submitInput1, submitInput2, submitInput3
      });
     
      HTMLDocumentImpl startingDoc = rcontext.getCurrentDocument();
      if(startingDoc == null)
      {
        throw new IllegalStateException("No document available for startup location.");
      }
     
View Full Code Here

    Integer numberOfReferences   = 0;
    Integer numberOfSeeAlso    = 0;
    try
    {
      UserAgentContext uacontext = new MozillaUserAgent();
      LocalHtmlRendererContext rcontext = new LocalHtmlRendererContext(uacontext);
     
      conceptName = breakCapitalizedConcepts(conceptName, "_");
      Logger.getLogger(Processor.class.getName()).info("Wiki for " + conceptName);
     
      URL url = org.lobobrowser.util.Urls.guessURL(SEARCH_STRING + conceptName);
     
      rcontext.submitForm("GET", url, "_this", null, null);
     
      HTMLDocumentImpl startingDoc = rcontext.getCurrentDocument();
      if(startingDoc == null)
      {
        throw new IllegalStateException("No document available for startup location.");
      }
     
View Full Code Here

TOP

Related Classes of org.ar.domainspecific.tools.webparser.LocalHtmlRendererContext

Copyright © 2018 www.massapicom. 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.