Hi everyone
I'm really new to power query and have created some basic code to scrape a table from a website (mainly through the UI with a couple of tweaks in advanced editor). However, because of the way that websites loads the table it sometimes returns blank. It's not a lot of data so refreshing until it is non-blank should be fine.
let
Source = Function.InvokeAfter(
()=> Web.Page(Web.Contents("https://www.sportingindex.com/spread-betting/golf/ryder-cup/group_c.1ed2996f-9381-40e8-bef8-0f7ae460b2ec/ryder-cup-outright-markets")),
#duration(0,0,0,0)),
Data0 = Source{0}[Data],
#"Removed Columns" = Table.RemoveColumns(Data0,{"", "Column6", "Column7", "Current"}),
#"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{Table.ColumnNames(Data0){0}, "SPIN"}})
in
#"Renamed Columns"
When the data I want is not returned by the query the first row will be "No markets available". So can anyone help with IF the first row under the header in column 1 is "No markets available" THEN LOOP the data import until row 1 column 1 <> "No markets available".
It feels like it should be really simple to me but I just can't find much online to help me out with it. I thought Function.InvokeAfter may help but no joy (is why it's set at zero above)
Thanks in advance for any help
Bookmarks