Uploaded image for project: 'Tika'
  1. Tika
  2. TIKA-1303

Parsing Html page (not well formed) containing two title tags results in metadata (title) to be overwritten

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.2, 1.3, 1.4, 1.5
    • 1.6
    • metadata, parser

    Description

      While crawling following web page, we came accross a strange issue where by title for page was not being extracted accurately:
      http://www.samsung.com/us/support/faq/FAQ00052677/61239/SM-C105AZWAATT

      This html page is not well formed and contains two title tags (one in head and one is body):
      e.g. "<html><title>Simple Content</title><body><h1></h1><title>TitleToIgnore</title></body></html>"

      Now in this case a simple fix to htmlhandler could make sure that once title value has been set in metadata, it should not be overridden when another title tag is subsequently found.

      I am submitting fix for this issue as a path for review (1.5) - hoping that this could be committed to latest?

      Can you please review and update kindly.

      Attachments

        1. HtmlHandler.java
          12 kB
          Hassan Akram
        2. HtmlParserTest.java
          41 kB
          Hassan Akram
        3. TIKA-1303.patch
          2 kB
          Hassan Akram

        Activity

          People

            kkrugler Kenneth William Krugler
            hakram Hassan Akram
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: