Skip to content

bug/content within custom HTML tags is skipped #3708

Closed

Description

@lwollenbergfuzzy

While reading html files we encountered the problem that we end up with an empty list.

Here is a small example:

from unstructured.partition.html import partition_html
html_content="""
<!DOCTYPE html>
<html class="client-nojs" lang="de" dir="ltr">
<head>
</head>
<body>
  <div id="content" class="mw-body" role="main">
    <Seitenname>Bestellvorschläge weiterbearbeiten</Seitenname>
    <hr>
    <div class="content">
      <hauptteil_AB>
        <div class="rumpftabelle"></div>
        <table>
          <tbody>
            <tr>
              <th>Intern</th>
              <th>Feldwerte
              </th>
            </tr>
            <tr>
              <td>J</td>
              <td>Ja
              </td>
            </tr>
            <tr>
              <td>N</td>
              <td>Nein
              </td>
            </tr>
          </tbody>
        </table>
    </div>
    </hauptteil_AB>
    <fussteil_B></fussteil_B>
  </div>
  </div>
</body>
</html>
"""
elements = partition_html(text=html_content)
print(elements)
out[0]: []

We would expect something like

out[0]: [<unstructured.documents.elements.Title object>, <unstructured.documents.elements.Table object>]

We use version 0.15.13 of unstructured.

Through try and error, the problem seems to come from the custom tags <hauptteil_AB> and <fussteil_B>.
We appreciate any help on this issue.

Activity

  1. added
    bug
    on Oct 9, 2024
  2. deku0818 commented on Oct 12, 2024

    @deku0818

    The same problem.

  3. MiloMoerkerke commented on Oct 15, 2024

    @MiloMoerkerke

    Same here

  4. PhorstenkampFuzzy commented on Oct 15, 2024

    @PhorstenkampFuzzy

    +1

  5. PhorstenkampFuzzy commented on Oct 28, 2024

    @PhorstenkampFuzzy

    Anything new here? Even a coment would help on how to preporcess something like this.

  6. ajainfuzzy commented on Oct 28, 2024

    @ajainfuzzy

    +1

  7. jjleng commented on Nov 18, 2024

    @jjleng

    Same problem.

    I guess the cause is here:

    It seems this is a feature, but it makes the HTML parser unable to parse custom HTML tags appropriately.

  8. scanny commented on Dec 18, 2024

    @scanny
    Contributor

    Closing in place of feature request #3842. Feel free to add remarks or +1s there :)

  9. changed the title [-]bug/reading html file returns empty list[/-] [+]bug/content within custom HTML tags is skipped[/+] on Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bughtml

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions