Package org.htmlparser.scanners

Examples of org.htmlparser.scanners.LinkScanner


   * tag is not identified. Creation date: (6/17/2001 4:01:06 PM)
   */
  public void testLinkNodeBug() throws ParserException {
    createParser("<A HREF=\"../test.html\">abcd</A>", "http://www.google.com/test/index.html");
    // Register the image scanner
    parser.addScanner(new LinkScanner("-l"));

    parseAndAssertNodeCount(1);
    // The node should be an HTMLLinkTag
    assertTrue("Node should be a HTMLLinkTag", node[0] instanceof LinkTag);
    LinkTag linkNode = (LinkTag) node[0];
View Full Code Here


   * tag is not identified. Creation date: (6/17/2001 4:01:06 PM)
   */
  public void testLinkNodeBug2() throws ParserException {
    createParser("<A HREF=\"../../test.html\">abcd</A>", "http://www.google.com/test/test/index.html");
    // Register the image scanner
    parser.addScanner(new LinkScanner("-l"));

    parseAndAssertNodeCount(1);
    // The node should be an HTMLLinkTag
    assertTrue("Node should be a HTMLLinkTag", node[0] instanceof LinkTag);
    LinkTag linkNode = (LinkTag) node[0];
View Full Code Here

   * (6/17/2001 4:01:06 PM)
   */
  public void testLinkNodeBug3() throws ParserException {
    createParser("<A HREF=\"/mylink.html\">abcd</A>", "http://www.cj.com/");
    // Register the image scanner
    parser.addScanner(new LinkScanner("-l"));

    parseAndAssertNodeCount(1);
    // The node should be an HTMLLinkTag
    assertTrue("Node should be a HTMLLinkTag", node[0] instanceof LinkTag);
    LinkTag linkNode = (LinkTag) node[0];
View Full Code Here

   * submitted by Roget Kjensrud Creation date: (6/17/2001 4:01:06 PM)
   */
  public void testLinkNodeBug4() throws ParserException {
    createParser("<A HREF=\"/mylink.html\">abcd</A>", "http://www.cj.com");
    // Register the image scanner
    parser.addScanner(new LinkScanner("-l"));

    parseAndAssertNodeCount(1);
    // The node should be an HTMLLinkTag
    assertTrue("Node should be a HTMLLinkTag", node[0] instanceof LinkTag);
    LinkTag linkNode = (LinkTag) node[0];
View Full Code Here

    createParser("<a href=http://note.kimo.com.tw/>���O</a>&nbsp; <a \n"
        + "href=http://photo.kimo.com.tw/>��ï</a>&nbsp; <a\n"
        + "href=http://address.kimo.com.tw/>�q�T��</a>&nbsp;&nbsp;", "http://www.cj.com");
    Parser.setLineSeparator("\r\n");
    // Register the image scanner
    parser.addScanner(new LinkScanner("-l"));

    parseAndAssertNodeCount(6);
    // The node should be an LinkTag
    assertTrue("Node should be a LinkTag", node[0] instanceof LinkTag);
    LinkTag linkNode = (LinkTag) node[2];
View Full Code Here

        + "coords=0,0,52,52 href=\"http://www.yahoo.com/r/c1\" shape=RECT><AREA"
        + "coords=53,0,121,52 href=\"http://www.yahoo.com/r/p1\" shape=RECT><AREA"
        + "coords=122,0,191,52 href=\"http://www.yahoo.com/r/m1\" shape=RECT><AREA"
        + "coords=441,0,510,52 href=\"http://www.yahoo.com/r/wn\" shape=RECT>", "http://www.cj.com/");
    // Register the image scanner
    parser.addScanner(new LinkScanner("-l"));
    parseAndAssertNodeCount(6);
  }
View Full Code Here

   * scanning a tag using LinkScanner. Creation date: (7/1/2001 2:42:13 PM)
   */
  public void testLinkNodeMailtoBug() throws ParserException {
    createParser("<A HREF='mailto:somik@yahoo.com'>hello</A>", "http://www.cj.com/");
    // Register the image scanner
    parser.addScanner(new LinkScanner("-l"));

    parseAndAssertNodeCount(1);
    assertTrue("Node should be a HTMLLinkTag", node[0] instanceof LinkTag);
    LinkTag linkNode = (LinkTag) node[0];
    assertStringEquals("Link incorrect", "somik@yahoo.com", linkNode.getLink());
View Full Code Here

   */
  public void testLinkNodeSingleQuoteBug() throws ParserException {
    createParser("<A HREF='abcd.html'>hello</A>", "http://www.cj.com/");

    // Register the image scanner
    parser.addScanner(new LinkScanner("-l"));

    parseAndAssertNodeCount(1);
    assertTrue("Node should be a HTMLLinkTag", node[0] instanceof LinkTag);
    LinkTag linkNode = (LinkTag) node[0];
    assertEquals("Link incorrect", "http://www.cj.com/abcd.html", linkNode.getLink());
View Full Code Here

   * tag is not identified. Creation date: (6/17/2001 4:01:06 PM)
   */
  public void testLinkTag() throws ParserException {
    createParser("<A HREF=\"test.html\">abcd</A>", "http://www.google.com/test/index.html");
    // Register the image scanner
    parser.addScanner(new LinkScanner("-l"));

    parseAndAssertNodeCount(1);
    // The node should be an HTMLLinkTag
    assertTrue("Node should be a HTMLLinkTag", node[0] instanceof LinkTag);
    LinkTag LinkTag = (LinkTag) node[0];
View Full Code Here

   * tag is not identified. Creation date: (6/17/2001 4:01:06 PM)
   */
  public void testLinkTagBug() throws ParserException {
    createParser("<A HREF=\"../test.html\">abcd</A>", "http://www.google.com/test/index.html");
    // Register the image scanner
    parser.addScanner(new LinkScanner("-l"));

    parseAndAssertNodeCount(1);
    // The node should be an HTMLLinkTag
    assertTrue("Node should be a HTMLLinkTag", node[0] instanceof LinkTag);
    LinkTag LinkTag = (LinkTag) node[0];
View Full Code Here

TOP

Related Classes of org.htmlparser.scanners.LinkScanner

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.