Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8049933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:55:33+00:00 2026-06-05T06:55:33+00:00

my problem is i have to extracts all of tables from an html document

  • 0

my problem is i have to extracts all of tables from an html document and put them in a list of tables.

Hence i understand that the ending function type should be

getTable :: a [XmlTree] [[String]]

for example with the following xml:

<table class="t1">
<tr>
    <td>x</td>
    <td>y</td>
</tr>
<tr>
    <td>a</td>
    <td>b</td>
</tr>
</table>
<table class="t2">
<tr>
    <td>3</td>
    <td>5</td>
</tr>
<tr>
    <td>toto</td>
    <td>titi</td>
</tr>
</table>

i know how to retrieve all the rows from one xmlTree (example1) or all the tags “tables” which provides me the type [XmlTree], but i don’t know how to map the arrow example1 inside the result of test2.

I’m sure its obvious but i can’t find it.

test2 ::  IO [[XmlTree]]
test2 = runX $ parseXML "table.xml" >>> is "table">>> listA getChildren

example1 ::  ArrowXml a => a XmlTree [String]
example1  = is "table" /> listA (getChildren >>> is "td"  /> getText)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T06:55:35+00:00Added an answer on June 5, 2026 at 6:55 am

    Using the same general idea that you have in example1, we can write getTable like this

    getTable :: ArrowXml a => a XmlTree [[String]]
    getTable =  hasName "table" >>> listA (rows >>> listA cols) where
        rows = getChildren >>> hasName "tr"
        cols = getChildren >>> hasName "td" /> getText
    

    Running the arrow on your example document produces

    [[["x","y"],["a","b"]],[["3","5"],["toto","titi"]]]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a big problem. I want to extract text from html table that
Problem I have a User model, and the Volunteer model that inherits from the
I have specific problem. I need to extract domain names from active directory and
I've seen that a few instances of this problem have been raised already. However,
Problem: I have a WCF service that invokes methods via reflection and sends the
Problem: I have a list containg hours, for example: 08:15:00 08:45:00 09:00:00 12:00:00 ...
Problem We have a DBA provided wrapper script that is used to execute a
Problem : I have a hand held device that scans those graphic color barcodes
is that possible to extract out all the data in second sheet from each
I have a DateTime column. I want to extract all records, lets say, from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.