Menu

Link Extraction: BaseHrefTag getBaseUrl()

Help
Anonymous
2004-06-01
2004-06-02
  • Anonymous

    Anonymous - 2004-06-01

    I'm trying to modify the sample LinkExtractor application and I'm having difficulty extracting the href attribute.

    The sample application LinkExtractor :

    System.out.println (list.elementAt(i).toHtml());

    I get values such as:
    <a href="index.htm">Home</a>

    Do I use?:
    BaseHrefTag getBaseUrl()

    How do I get at the href attribute?

    Is there any other sample code?

    Great package! Many thanks,

    Perren

     
    • Matt Ruby

      Matt Ruby - 2004-06-01

      Check out the wiki sample code:
      http://htmlparser.sourceforge.net/wiki/index.php/LinkExtraction

      I think that is what you are looking for.

      Matt

       
    • Derrick Oswald

      Derrick Oswald - 2004-06-02

      LinkTag.getLink() has already applied any <BASE> url to return an absolute URL. If you want the raw HREF attribute use LinkTag.getAttribute ("HREF");

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.