# \[ANN\] TableScraper.jl - an easy way to scrape WELL-FORMED tables from webpages

**URL:** <https://discourse.julialang.org/t/ann-tablescraper-jl-an-easy-way-to-scrape-well-formed-tables-from-webpages/61636>\
**Category:** Package Announcements\
**Tags:** tables, io\
**Created:** [May 22, 2021, 1:43pm UTC](https://discourse.julialang.org/t/ann-tablescraper-jl-an-easy-way-to-scrape-well-formed-tables-from-webpages/61636 "2021-05-22T13:43:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Post date:** [May 22, 2021, 1:43pm UTC](https://discourse.julialang.org/t/ann-tablescraper-jl-an-easy-way-to-scrape-well-formed-tables-from-webpages/61636/1 "2021-05-22T13:43:30Z")

</div>

[![](https://global.discourse-cdn.com/julialang/original/3X/d/0/d09342f60f489b5afec94ada97d8e78f7a585961.jpeg "Introducing TableScraper.jl - an easy way to scrape WELL-FORMED tables in Julia") ](https://www.youtube.com/watch?v=Bi1faYTkIGM)

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [May 22, 2021, 2:23pm UTC](https://discourse.julialang.org/t/ann-tablescraper-jl-an-easy-way-to-scrape-well-formed-tables-from-webpages/61636/2 "2021-05-22T14:23:42Z")

</div>

Can also be scraped [here](https://github.com/xiaodaigh/TableScraper.jl).

---

<div class="post-metadata">

**Author:** ![TheLateKronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thelatekronos/32/12824_2.png) [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Post date:** [June 9, 2021, 9:39am UTC](https://discourse.julialang.org/t/ann-tablescraper-jl-an-easy-way-to-scrape-well-formed-tables-from-webpages/61636/3 "2021-06-09T09:39:23Z")

</div>

Nice. Is it possible to use this to get wikipedia tables as LaTeX?

Specifically [this one](https://en.wikipedia.org/wiki/Z-transform#Table_of_common_Z-transform_pairs) would look great in my LaTeX equation sheet, as opposed to my current screenshot.

---

<div class="post-metadata">

**Author:** ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Post date:** [June 9, 2021, 11:18am UTC](https://discourse.julialang.org/t/ann-tablescraper-jl-an-easy-way-to-scrape-well-formed-tables-from-webpages/61636/4 "2021-06-09T11:18:12Z")

</div>

the table looks wellformed so you can scrape it. but u need to know some css and HTML to do it properly i’d say.

---

<div class="post-metadata">

**Author:** ![TheLateKronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thelatekronos/32/12824_2.png) [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Post date:** [June 9, 2021, 1:40pm UTC](https://discourse.julialang.org/t/ann-tablescraper-jl-an-easy-way-to-scrape-well-formed-tables-from-webpages/61636/5 "2021-06-09T13:40:08Z")

</div>

I dont unfortunatly… Oh well

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [June 9, 2021, 2:10pm UTC](https://discourse.julialang.org/t/ann-tablescraper-jl-an-easy-way-to-scrape-well-formed-tables-from-webpages/61636/6 "2021-06-09T14:10:02Z")

</div>

just wanted to check out the package quickly, something like this seemed to kind of work

```julia
@chain begin
           scrape_tables("https://en.wikipedia.org/wiki/Z-transform", identity)
           _[8]
           DataFrame
           transform(1 => ByRow(nodeText) => :number)
           transform(2:4 .=> ByRow(function(x)
               try
                   x.children[1].children[2].attributes["alt"]
               catch
                   missing
               end
           end) .=> ["Signal", "Z-Transform", "ROC"])
           select(Not(1:4))
        end

```

---

<div class="post-metadata">

**Author:** ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Post date:** [June 9, 2021, 10:22pm UTC](https://discourse.julialang.org/t/ann-tablescraper-jl-an-easy-way-to-scrape-well-formed-tables-from-webpages/61636/7 "2021-06-09T22:22:05Z")

</div>

Well done I guess it’s not that hard

---

<div class="post-metadata">

**Author:** ![Marc.Cox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marc.cox/32/7514_2.png) [@Marc.Cox](https://discourse.julialang.org/u/Marc.Cox)\
**Post date:** [September 30, 2021, 11:58pm UTC](https://discourse.julialang.org/t/ann-tablescraper-jl-an-easy-way-to-scrape-well-formed-tables-from-webpages/61636/8 "2021-09-30T23:58:25Z")

</div>

Just noticed this announcement for TableScraper.jl it looks good.

BTW about an easy way to scrape " _WELL-FORMED tables_ " from webpages ;  
I believe you can (mostly) eliminate the caveat/requirement/limitation  
of " WELL-FORMED tables " by using tidy-html5 as per \>\>

Tidy tidies HTML, XML and tidy-HTML5 - Github code repo [https://github.com/htacg/tidy-html5](https://github.com/htacg/tidy-html5) .

About “Regular” Tidy tidies [https://www.html-tidy.org/](https://www.html-tidy.org/)

> It can tidy your documents by itself, and developers can easily integrate its  
> features into even more powerful tools.

And upon reflection I believe you might even guess of the existence of  
something like “tidy-html5” because of the fact that browsers  
can display almost all tables be they _WELL-FORMED , ILL-Formed, or not_ 🙂

HTH,  
Marc

---

<div class="post-metadata">

**Author:** ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Post date:** [October 1, 2021, 12:14am UTC](https://discourse.julialang.org/t/ann-tablescraper-jl-an-easy-way-to-scrape-well-formed-tables-from-webpages/61636/9 "2021-10-01T00:14:27Z")

</div>

Interesting. TIL about these tidy tools. I might look at it if the need arises. Currenlty, the scraper works pretty well for my basic needs.
