---
title: "Discussion on \"Extracting HTML table from a web page (or HTML file) and converting it into PowerShell object\" | Hashnode"
description: "Discussion on \"Extracting HTML table from a web page (or HTML file) and converting it into PowerShell object\". Several months ago I've created ConvertFrom-HTMLTable function for helping me extract HTML tables from locally saved HTML files or live web pages and convert  them into usable PowerShell objects. So it is not a new function but I think it deserves a ..."
url: "https://hashnode.com/posts/extracting-html-table-from-a-web-page-or-html-file-and-converting-it-into-powershell-object/61b0f379ccd13f578941ec09"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Extracting HTML table from a web page (or HTML file) and converting it into PowerShell object](https://doitpshway.com/extracting-html-table-from-a-web-page-or-html-file-and-converting-it-into-powershell-object?utm_source=hashnode&utm_medium=feed)

Several months ago I've created ConvertFrom-HTMLTable function for helping me extract HTML tables from locally saved HTML files or live web pages and convert them into usable PowerShell objects. So it is not a new function but I think it deserves a ...

Dec 8, 2021 · 2 min read · doitpshway.com  
Read the article

-   [#powershell](https://hashnode.com/tag/powershell)

## Written by

[Ondrej Sebela](https://hashnode.com/@AndrewZtrhgf)

@AndrewZtrhgf · Czech Republic

  
[View profile](https://hashnode.com/@AndrewZtrhgf)

System Administrator that loves PowerShell

I work as System Administrator for more than 15 years now and I love to make my life easier by automating work &amp; personal stuff via PowerShell (even silly things like food recipes list generation).

## Responses 2

Markdown supported · ⌘↵ to post

[JustBry](https://hashnode.com/@JustBry)

[Jun 19, 2022](https://hashnode.com/posts/extracting-html-table-from-a-web-page-or-html-file-and-converting-it-into-powershell-object/61b0f379ccd13f578941ec09/comment/62af74d40924134a8048a737)

This looks great; think this will work on html email that contains a table?

~JB

[Ondrej Sebela](https://hashnode.com/@AndrewZtrhgf)

[Jun 19, 2022](https://hashnode.com/posts/extracting-html-table-from-a-web-page-or-html-file-and-converting-it-into-powershell-object/61b0f379ccd13f578941ec09/comment/62af74d40924134a8048a737#reply-62af778d0924134a8048a78f)

I don't see why it shouldn't. If you will be able to extract that HTML from the email body.

[JustBry](https://hashnode.com/@JustBry)

[Jun 19, 2022](https://hashnode.com/posts/extracting-html-table-from-a-web-page-or-html-file-and-converting-it-into-powershell-object/61b0f379ccd13f578941ec09/comment/62af74d40924134a8048a737#reply-62af78b20924134a8048a7a9)

Tried and get the following:

"At line:103 char:73

-   ... tent = Invoke-WebRequest -Method GET -Headers $Headers -Uri <!DOCTYPE ...
-   ~ The '<' operator is reserved for future use.

At line:118 char:8

-   @media only screen and (max-width: 640px) {
-   \~~~~ Unexpected token 'only' in expression or statement.

At line:126 char:8

-   @media only screen and (max-width: 640px) {
-   \~~~~ Unexpected token 'only' in expression or statement.

At line:134 char:8

-   @media only screen and (max-width: 640px) {
-   \~~~~ Unexpected token 'only' in expression or statement.

At line:142 char:8

-   @media only screen and (max-width: 640px) {
-   \~~~~ Unexpected token 'only' in expression or statement.

At line:151 char:8

-   @media only screen and (max-width: 640px) {
-   \~~~~ Unexpected token 'only' in expression or statement.

At line:165 char:8

-   @media only screen and (max-width: 640px) {
-   \~~~~ Unexpected token 'only' in expression or statement.

At line:173 char:8

-   @media only screen and (max-width: 640px) {
-   \~~~~ Unexpected token 'only' in expression or statement.

Not all parse errors were reported. Correct the reported errors and try again."

[Jackson Brumbaugh](https://hashnode.com/@JackalBruit)

[Feb 6, 2022](https://hashnode.com/posts/extracting-html-table-from-a-web-page-or-html-file-and-converting-it-into-powershell-object/61b0f379ccd13f578941ec09/comment/62001741295d276006774e5d)

Hey!

Is this function source code on ur GitHub?

Or is that a PowerShell native command?

> Jackson

[Ondrej Sebela](https://hashnode.com/@AndrewZtrhgf)

[Feb 6, 2022](https://hashnode.com/posts/extracting-html-table-from-a-web-page-or-html-file-and-converting-it-into-powershell-object/61b0f379ccd13f578941ec09/comment/62001741295d276006774e5d#reply-620018793a8a6e5fe1197f3c)

It's on my github [github.com/ztrhgf/useful\_powershell\_functions/blo…](https://github.com/ztrhgf/useful_powershell_functions/blob/master/ConvertFrom-HTMLTable.ps1)

[Jackson Brumbaugh](https://hashnode.com/@JackalBruit)

[Feb 6, 2022](https://hashnode.com/posts/extracting-html-table-from-a-web-page-or-html-file-and-converting-it-into-powershell-object/61b0f379ccd13f578941ec09/comment/62001741295d276006774e5d#reply-6200190c3a8a6e5fe1197f5f)

Thanks!

[Ondrej Sebela](https://hashnode.com/@AndrewZtrhgf)
