Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Can anyone help me extract the data from the tabel in the following website ?
TGJ23.F - Dutch TTF Gas Apr 2023 - Stooq
Here's one way to do it in the query editor. To see how it works, just create a blank query, open the Advanced Editor and replace the text there with the M code below.
let
Source = Web.BrowserContents("https://stooq.com/q/d/?s=tgj23.f&i=d&l=1"),
#"Extracted Table From Html" = Html.Table(Source, {{"Column1", "TABLE[id='fth1'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(9), TABLE[id='fth1'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(10)"}, {"Column2", "TABLE[id='fth1'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(8), TABLE[id='fth1'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(10) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(9)"}, {"Column3", "TABLE[id='fth1'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(7), TABLE[id='fth1'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(10) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(8)"}, {"Column4", "TABLE[id='fth1'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(6), TABLE[id='fth1'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(10) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(7)"}, {"Column5", "TABLE[id='fth1'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(5), TABLE[id='fth1'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(10) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(6)"}, {"Column6", "TABLE[id='fth1'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(4), TABLE[id='fth1'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(10) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(5)"}, {"Column7", "TABLE[id='fth1'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(4) + TD[colspan=""2""]:not([rowspan]):nth-child(7):nth-last-child(3), TABLE[id='fth1'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(10) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(7):nth-last-child(4)"}, {"Column8", "TABLE[id='fth1'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(4) + TD[colspan=""2""]:not([rowspan]):nth-child(7):nth-last-child(3), TABLE[id='fth1'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(10) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(7):nth-last-child(4) + TD:not([colspan]):not([rowspan]):nth-child(8):nth-last-child(3)"}, {"Column9", "TABLE[id='fth1'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(4) + TD[colspan=""2""]:not([rowspan]):nth-child(7):nth-last-child(3) + TD:not([colspan]):not([rowspan]):nth-child(8):nth-last-child(2), TABLE[id='fth1'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(10) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(7):nth-last-child(4) + TD:not([colspan]):not([rowspan]):nth-child(8):nth-last-child(3) + TD:not([colspan]):not([rowspan]):nth-child(9):nth-last-child(2)"}, {"Column10", "TABLE[id='fth1'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(4) + TD[colspan=""2""]:not([rowspan]):nth-child(7):nth-last-child(3) + TD:not([colspan]):not([rowspan]):nth-child(8):nth-last-child(2) + TD:not([colspan]):not([rowspan]):nth-child(9):nth-last-child(1), TABLE[id='fth1'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(10) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(7):nth-last-child(4) + TD:not([colspan]):not([rowspan]):nth-child(8):nth-last-child(3) + TD:not([colspan]):not([rowspan]):nth-child(9):nth-last-child(2) + TD:not([colspan]):not([rowspan]):nth-child(10):nth-last-child(1)"}}, [RowSelector="TABLE[id='fth1'] > * > TR"]),
#"Promoted Headers" = Table.PromoteHeaders(#"Extracted Table From Html", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"No.", Int64.Type}, {"Date", type date}, {"Open", type number}, {"High", type number}, {"Low", type number}, {"Close", type number}, {"Change", Percentage.Type}, {"Change_1", type number}, {"Volume", Int64.Type}, {"Open Interest", Int64.Type}})
in
#"Changed Type"
Pat
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 6 | |
| 4 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 11 | |
| 10 | |
| 7 | |
| 7 | |
| 6 |