Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Adam-S
Regular Visitor

Website table Xpath not showing in Children

Hello,

 

I am trying to access the table shown in the below link, however, when navigating the Children tables according to the Xpath of the table from the webpage it does not appear. I assume it's because it's an interactive table on the website and may have some restrictions (I'm not very versed in accessing web content yet), so I was wondering if there is a particular method of bringing this table in via Power Query. Thanks for any guidance

https://apps.bea.gov/iTable/iTable.cfm?reqid=19&step=3&isuri=1&nipa_table_list=13&categories=survey

Xpath: /html/body/div[1]/div[2]/div/div/div[2]/div/div[3]/div/div[3]/form/div/div/div/div[2]/div/div/div[2]/div[2]/table

 

Best,

Adam

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

This monstrosity seems to work

 

let
    Source = Web.BrowserContents("https://apps.bea.gov/iTable/iTable.cfm?reqid=19&step=3&isuri=1&nipa_table_list=13&categories=survey"),
    #"Extracted Table From Html" = Html.Table(Source, {{"Column1", "TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""2""]:nth-child(1):nth-last-child(5), TABLE[id='tbl'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(11)"}, {"Column2", "TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""2""]:nth-child(1):nth-last-child(5) + TH[colspan=""1""][rowspan=""2""]:nth-child(2):nth-last-child(4), TABLE[id='tbl'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(11) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(10)"}, {"Column3", "TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""2""]:nth-child(1):nth-last-child(5) + TH[colspan=""1""][rowspan=""2""]:nth-child(2):nth-last-child(4) + TH[colspan=""4""][rowspan=""1""]:nth-child(3):nth-last-child(3), TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""1""]:nth-child(1):nth-last-child(9), TABLE[id='tbl'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(11) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(10) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(9)"}, {"Column4", "TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""2""]:nth-child(1):nth-last-child(5) + TH[colspan=""1""][rowspan=""2""]:nth-child(2):nth-last-child(4) + TH[colspan=""4""][rowspan=""1""]:nth-child(3):nth-last-child(3), TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""1""]:nth-child(1):nth-last-child(9) + TH[colspan=""1""][rowspan=""1""]:nth-child(2):nth-last-child(8), TABLE[id='tbl'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(11) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(10) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(8)"}, {"Column5", "TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""2""]:nth-child(1):nth-last-child(5) + TH[colspan=""1""][rowspan=""2""]:nth-child(2):nth-last-child(4) + TH[colspan=""4""][rowspan=""1""]:nth-child(3):nth-last-child(3), TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""1""]:nth-child(1):nth-last-child(9) + TH[colspan=""1""][rowspan=""1""]:nth-child(2):nth-last-child(8) + TH[colspan=""1""][rowspan=""1""]:nth-child(3):nth-last-child(7), TABLE[id='tbl'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(11) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(10) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(7)"}, {"Column6", "TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""2""]:nth-child(1):nth-last-child(5) + TH[colspan=""1""][rowspan=""2""]:nth-child(2):nth-last-child(4) + TH[colspan=""4""][rowspan=""1""]:nth-child(3):nth-last-child(3), TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""1""]:nth-child(1):nth-last-child(9) + TH[colspan=""1""][rowspan=""1""]:nth-child(2):nth-last-child(8) + TH[colspan=""1""][rowspan=""1""]:nth-child(3):nth-last-child(7) + TH[colspan=""1""][rowspan=""1""]:nth-child(4):nth-last-child(6), TABLE[id='tbl'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(11) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(10) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(6)"}, {"Column7", "TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""2""]:nth-child(1):nth-last-child(5) + TH[colspan=""1""][rowspan=""2""]:nth-child(2):nth-last-child(4) + TH[colspan=""4""][rowspan=""1""]:nth-child(3):nth-last-child(3) + TH[colspan=""4""][rowspan=""1""]:nth-child(4):nth-last-child(2), TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""1""]:nth-child(1):nth-last-child(9) + TH[colspan=""1""][rowspan=""1""]:nth-child(2):nth-last-child(8) + TH[colspan=""1""][rowspan=""1""]:nth-child(3):nth-last-child(7) + TH[colspan=""1""][rowspan=""1""]:nth-child(4):nth-last-child(6) + TH[colspan=""1""][rowspan=""1""]:nth-child(5):nth-last-child(5), TABLE[id='tbl'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(11) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(10) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(7):nth-last-child(5)"}, {"Column8", "TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""2""]:nth-child(1):nth-last-child(5) + TH[colspan=""1""][rowspan=""2""]:nth-child(2):nth-last-child(4) + TH[colspan=""4""][rowspan=""1""]:nth-child(3):nth-last-child(3) + TH[colspan=""4""][rowspan=""1""]:nth-child(4):nth-last-child(2), TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""1""]:nth-child(1):nth-last-child(9) + TH[colspan=""1""][rowspan=""1""]:nth-child(2):nth-last-child(8) + TH[colspan=""1""][rowspan=""1""]:nth-child(3):nth-last-child(7) + TH[colspan=""1""][rowspan=""1""]:nth-child(4):nth-last-child(6) + TH[colspan=""1""][rowspan=""1""]:nth-child(5):nth-last-child(5) + TH[colspan=""1""][rowspan=""1""]:nth-child(6):nth-last-child(4), TABLE[id='tbl'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(11) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(10) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(7):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(8):nth-last-child(4)"}, {"Column9", "TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""2""]:nth-child(1):nth-last-child(5) + TH[colspan=""1""][rowspan=""2""]:nth-child(2):nth-last-child(4) + TH[colspan=""4""][rowspan=""1""]:nth-child(3):nth-last-child(3) + TH[colspan=""4""][rowspan=""1""]:nth-child(4):nth-last-child(2), TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""1""]:nth-child(1):nth-last-child(9) + TH[colspan=""1""][rowspan=""1""]:nth-child(2):nth-last-child(8) + TH[colspan=""1""][rowspan=""1""]:nth-child(3):nth-last-child(7) + TH[colspan=""1""][rowspan=""1""]:nth-child(4):nth-last-child(6) + TH[colspan=""1""][rowspan=""1""]:nth-child(5):nth-last-child(5) + TH[colspan=""1""][rowspan=""1""]:nth-child(6):nth-last-child(4) + TH[colspan=""1""][rowspan=""1""]:nth-child(7):nth-last-child(3), TABLE[id='tbl'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(11) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(10) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(7):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(8):nth-last-child(4) + TD:not([colspan]):not([rowspan]):nth-child(9):nth-last-child(3)"}, {"Column10", "TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""2""]:nth-child(1):nth-last-child(5) + TH[colspan=""1""][rowspan=""2""]:nth-child(2):nth-last-child(4) + TH[colspan=""4""][rowspan=""1""]:nth-child(3):nth-last-child(3) + TH[colspan=""4""][rowspan=""1""]:nth-child(4):nth-last-child(2), TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""1""]:nth-child(1):nth-last-child(9) + TH[colspan=""1""][rowspan=""1""]:nth-child(2):nth-last-child(8) + TH[colspan=""1""][rowspan=""1""]:nth-child(3):nth-last-child(7) + TH[colspan=""1""][rowspan=""1""]:nth-child(4):nth-last-child(6) + TH[colspan=""1""][rowspan=""1""]:nth-child(5):nth-last-child(5) + TH[colspan=""1""][rowspan=""1""]:nth-child(6):nth-last-child(4) + TH[colspan=""1""][rowspan=""1""]:nth-child(7):nth-last-child(3) + TH[colspan=""1""][rowspan=""1""]:nth-child(8):nth-last-child(2), TABLE[id='tbl'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(11) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(10) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(7):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(8):nth-last-child(4) + TD:not([colspan]):not([rowspan]):nth-child(9):nth-last-child(3) + TD:not([colspan]):not([rowspan]):nth-child(10):nth-last-child(2)"}, {"Column11", "TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""2""]:nth-child(1):nth-last-child(5) + TH[colspan=""1""][rowspan=""2""]:nth-child(2):nth-last-child(4) + TH[colspan=""4""][rowspan=""1""]:nth-child(3):nth-last-child(3) + TH[colspan=""4""][rowspan=""1""]:nth-child(4):nth-last-child(2) + TH[colspan=""1""][rowspan=""1""]:nth-child(5):nth-last-child(1), TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""1""]:nth-child(1):nth-last-child(9) + TH[colspan=""1""][rowspan=""1""]:nth-child(2):nth-last-child(8) + TH[colspan=""1""][rowspan=""1""]:nth-child(3):nth-last-child(7) + TH[colspan=""1""][rowspan=""1""]:nth-child(4):nth-last-child(6) + TH[colspan=""1""][rowspan=""1""]:nth-child(5):nth-last-child(5) + TH[colspan=""1""][rowspan=""1""]:nth-child(6):nth-last-child(4) + TH[colspan=""1""][rowspan=""1""]:nth-child(7):nth-last-child(3) + TH[colspan=""1""][rowspan=""1""]:nth-child(8):nth-last-child(2) + TH[colspan=""1""][rowspan=""1""]:nth-child(9):nth-last-child(1), TABLE[id='tbl'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(11) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(10) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(7):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(8):nth-last-child(4) + TD:not([colspan]):not([rowspan]):nth-child(9):nth-last-child(3) + TD:not([colspan]):not([rowspan]):nth-child(10):nth-last-child(2) + TD:not([colspan]):not([rowspan]):nth-child(11):nth-last-child(1)"}}, [RowSelector="TABLE[id='tbl'] > * > TR"])
in
    #"Extracted Table From Html"

 

 

 

but you might have more luck invoking the downloadTable function call directly. Specify the filetype as the payload.

 

 

 

function downloadTable(filetype)
{
	var form =$("#DownloadDataForm");
	$("#downloadtable-modal").modal("hide");
	if(form.length === 0)
	{
		form = $('<form id="DownloadDataForm" style="display:none;" target="_blank" method="post" action="download.cfm"></form>');
		form.append($('<input type="hidden" name="filetype"/>'));
		form.append($('<textarea name="rawdata" style="display:none"></textarea>'));
	}
	form.find("input[name='filetype']").val(filetype);
	form.find("textarea[name='rawdata']").val($("rowTableDataContainer").html())
	$('body').append(form);
	$(form).submit();
}

 

 

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

This monstrosity seems to work

 

let
    Source = Web.BrowserContents("https://apps.bea.gov/iTable/iTable.cfm?reqid=19&step=3&isuri=1&nipa_table_list=13&categories=survey"),
    #"Extracted Table From Html" = Html.Table(Source, {{"Column1", "TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""2""]:nth-child(1):nth-last-child(5), TABLE[id='tbl'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(11)"}, {"Column2", "TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""2""]:nth-child(1):nth-last-child(5) + TH[colspan=""1""][rowspan=""2""]:nth-child(2):nth-last-child(4), TABLE[id='tbl'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(11) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(10)"}, {"Column3", "TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""2""]:nth-child(1):nth-last-child(5) + TH[colspan=""1""][rowspan=""2""]:nth-child(2):nth-last-child(4) + TH[colspan=""4""][rowspan=""1""]:nth-child(3):nth-last-child(3), TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""1""]:nth-child(1):nth-last-child(9), TABLE[id='tbl'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(11) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(10) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(9)"}, {"Column4", "TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""2""]:nth-child(1):nth-last-child(5) + TH[colspan=""1""][rowspan=""2""]:nth-child(2):nth-last-child(4) + TH[colspan=""4""][rowspan=""1""]:nth-child(3):nth-last-child(3), TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""1""]:nth-child(1):nth-last-child(9) + TH[colspan=""1""][rowspan=""1""]:nth-child(2):nth-last-child(8), TABLE[id='tbl'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(11) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(10) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(8)"}, {"Column5", "TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""2""]:nth-child(1):nth-last-child(5) + TH[colspan=""1""][rowspan=""2""]:nth-child(2):nth-last-child(4) + TH[colspan=""4""][rowspan=""1""]:nth-child(3):nth-last-child(3), TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""1""]:nth-child(1):nth-last-child(9) + TH[colspan=""1""][rowspan=""1""]:nth-child(2):nth-last-child(8) + TH[colspan=""1""][rowspan=""1""]:nth-child(3):nth-last-child(7), TABLE[id='tbl'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(11) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(10) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(7)"}, {"Column6", "TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""2""]:nth-child(1):nth-last-child(5) + TH[colspan=""1""][rowspan=""2""]:nth-child(2):nth-last-child(4) + TH[colspan=""4""][rowspan=""1""]:nth-child(3):nth-last-child(3), TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""1""]:nth-child(1):nth-last-child(9) + TH[colspan=""1""][rowspan=""1""]:nth-child(2):nth-last-child(8) + TH[colspan=""1""][rowspan=""1""]:nth-child(3):nth-last-child(7) + TH[colspan=""1""][rowspan=""1""]:nth-child(4):nth-last-child(6), TABLE[id='tbl'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(11) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(10) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(6)"}, {"Column7", "TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""2""]:nth-child(1):nth-last-child(5) + TH[colspan=""1""][rowspan=""2""]:nth-child(2):nth-last-child(4) + TH[colspan=""4""][rowspan=""1""]:nth-child(3):nth-last-child(3) + TH[colspan=""4""][rowspan=""1""]:nth-child(4):nth-last-child(2), TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""1""]:nth-child(1):nth-last-child(9) + TH[colspan=""1""][rowspan=""1""]:nth-child(2):nth-last-child(8) + TH[colspan=""1""][rowspan=""1""]:nth-child(3):nth-last-child(7) + TH[colspan=""1""][rowspan=""1""]:nth-child(4):nth-last-child(6) + TH[colspan=""1""][rowspan=""1""]:nth-child(5):nth-last-child(5), TABLE[id='tbl'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(11) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(10) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(7):nth-last-child(5)"}, {"Column8", "TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""2""]:nth-child(1):nth-last-child(5) + TH[colspan=""1""][rowspan=""2""]:nth-child(2):nth-last-child(4) + TH[colspan=""4""][rowspan=""1""]:nth-child(3):nth-last-child(3) + TH[colspan=""4""][rowspan=""1""]:nth-child(4):nth-last-child(2), TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""1""]:nth-child(1):nth-last-child(9) + TH[colspan=""1""][rowspan=""1""]:nth-child(2):nth-last-child(8) + TH[colspan=""1""][rowspan=""1""]:nth-child(3):nth-last-child(7) + TH[colspan=""1""][rowspan=""1""]:nth-child(4):nth-last-child(6) + TH[colspan=""1""][rowspan=""1""]:nth-child(5):nth-last-child(5) + TH[colspan=""1""][rowspan=""1""]:nth-child(6):nth-last-child(4), TABLE[id='tbl'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(11) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(10) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(7):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(8):nth-last-child(4)"}, {"Column9", "TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""2""]:nth-child(1):nth-last-child(5) + TH[colspan=""1""][rowspan=""2""]:nth-child(2):nth-last-child(4) + TH[colspan=""4""][rowspan=""1""]:nth-child(3):nth-last-child(3) + TH[colspan=""4""][rowspan=""1""]:nth-child(4):nth-last-child(2), TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""1""]:nth-child(1):nth-last-child(9) + TH[colspan=""1""][rowspan=""1""]:nth-child(2):nth-last-child(8) + TH[colspan=""1""][rowspan=""1""]:nth-child(3):nth-last-child(7) + TH[colspan=""1""][rowspan=""1""]:nth-child(4):nth-last-child(6) + TH[colspan=""1""][rowspan=""1""]:nth-child(5):nth-last-child(5) + TH[colspan=""1""][rowspan=""1""]:nth-child(6):nth-last-child(4) + TH[colspan=""1""][rowspan=""1""]:nth-child(7):nth-last-child(3), TABLE[id='tbl'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(11) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(10) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(7):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(8):nth-last-child(4) + TD:not([colspan]):not([rowspan]):nth-child(9):nth-last-child(3)"}, {"Column10", "TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""2""]:nth-child(1):nth-last-child(5) + TH[colspan=""1""][rowspan=""2""]:nth-child(2):nth-last-child(4) + TH[colspan=""4""][rowspan=""1""]:nth-child(3):nth-last-child(3) + TH[colspan=""4""][rowspan=""1""]:nth-child(4):nth-last-child(2), TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""1""]:nth-child(1):nth-last-child(9) + TH[colspan=""1""][rowspan=""1""]:nth-child(2):nth-last-child(8) + TH[colspan=""1""][rowspan=""1""]:nth-child(3):nth-last-child(7) + TH[colspan=""1""][rowspan=""1""]:nth-child(4):nth-last-child(6) + TH[colspan=""1""][rowspan=""1""]:nth-child(5):nth-last-child(5) + TH[colspan=""1""][rowspan=""1""]:nth-child(6):nth-last-child(4) + TH[colspan=""1""][rowspan=""1""]:nth-child(7):nth-last-child(3) + TH[colspan=""1""][rowspan=""1""]:nth-child(8):nth-last-child(2), TABLE[id='tbl'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(11) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(10) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(7):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(8):nth-last-child(4) + TD:not([colspan]):not([rowspan]):nth-child(9):nth-last-child(3) + TD:not([colspan]):not([rowspan]):nth-child(10):nth-last-child(2)"}, {"Column11", "TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""2""]:nth-child(1):nth-last-child(5) + TH[colspan=""1""][rowspan=""2""]:nth-child(2):nth-last-child(4) + TH[colspan=""4""][rowspan=""1""]:nth-child(3):nth-last-child(3) + TH[colspan=""4""][rowspan=""1""]:nth-child(4):nth-last-child(2) + TH[colspan=""1""][rowspan=""1""]:nth-child(5):nth-last-child(1), TABLE[id='tbl'] > * > TR > TH[colspan=""1""][rowspan=""1""]:nth-child(1):nth-last-child(9) + TH[colspan=""1""][rowspan=""1""]:nth-child(2):nth-last-child(8) + TH[colspan=""1""][rowspan=""1""]:nth-child(3):nth-last-child(7) + TH[colspan=""1""][rowspan=""1""]:nth-child(4):nth-last-child(6) + TH[colspan=""1""][rowspan=""1""]:nth-child(5):nth-last-child(5) + TH[colspan=""1""][rowspan=""1""]:nth-child(6):nth-last-child(4) + TH[colspan=""1""][rowspan=""1""]:nth-child(7):nth-last-child(3) + TH[colspan=""1""][rowspan=""1""]:nth-child(8):nth-last-child(2) + TH[colspan=""1""][rowspan=""1""]:nth-child(9):nth-last-child(1), TABLE[id='tbl'] > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(11) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(10) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(9) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(7):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(8):nth-last-child(4) + TD:not([colspan]):not([rowspan]):nth-child(9):nth-last-child(3) + TD:not([colspan]):not([rowspan]):nth-child(10):nth-last-child(2) + TD:not([colspan]):not([rowspan]):nth-child(11):nth-last-child(1)"}}, [RowSelector="TABLE[id='tbl'] > * > TR"])
in
    #"Extracted Table From Html"

 

 

 

but you might have more luck invoking the downloadTable function call directly. Specify the filetype as the payload.

 

 

 

function downloadTable(filetype)
{
	var form =$("#DownloadDataForm");
	$("#downloadtable-modal").modal("hide");
	if(form.length === 0)
	{
		form = $('<form id="DownloadDataForm" style="display:none;" target="_blank" method="post" action="download.cfm"></form>');
		form.append($('<input type="hidden" name="filetype"/>'));
		form.append($('<textarea name="rawdata" style="display:none"></textarea>'));
	}
	form.find("input[name='filetype']").val(filetype);
	form.find("textarea[name='rawdata']").val($("rowTableDataContainer").html())
	$('body').append(form);
	$(form).submit();
}

 

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.