Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all, I'm trying to loop through various html's, e.g:
Through a local xlsx file which looks like below which is loaded in:
Channel | Channel_Links | Market | HD |
ABC1 | https://www.ontvtonight.com/au/guide/listings/channel/1990/abc1.html | Free TV | FALSE |
ABC-HD | https://www.ontvtonight.com/au/guide/listings/channel/2984/abc-hd.html | Free TV | TRUE |
ABC-COMEDY-ABC-KIDS | https://www.ontvtonight.com/au/guide/listings/channel/2043/abc-comedy-abc-kids.html | Free TV | FALSE |
ABC-ME | https://www.ontvtonight.com/au/guide/listings/channel/2096/abc-me.html | Free TV | FALSE |
ABC-NEWS | https://www.ontvtonight.com/au/guide/listings/channel/2149/abc-news.html | Free TV | FALSE |
SEVEN | https://www.ontvtonight.com/au/guide/listings/channel/1639/seven.html | Free TV | FALSE |
7-HD | https://www.ontvtonight.com/au/guide/listings/channel/2890/7-hd.html | Free TV | TRUE |
Due to the webpage, i'm getting 'BAD GATEWAY', and then it will end the execution. I am also going through various HTML's and therefore random ones fail and interrupt the chain each time.
For example I am currently running:
For i = 1 to NoOfRows('AUChannelTable')
Let vURL = Peek('Channel_Links',($(i)-1),'AUChannelTable');
Let vChannel = Peek('Channel',($(i)-1),'AUChannelTable');
Let vChannelID = SubField(SubField(vURL,'channel/',2),'/',1);
Let vMarket = Peek('Market',($(i)-1),'AUChannelTable');
Let vHD = Peek('HD',($(i)-1),'AUChannelTable');
Table:
LOAD
now(1) as QVD_Load_Time
, '$(vChannel)' as Channel
, '$(vChannelID)' as CID
, '$(vMarket)' as Market
, '$(vHD)' as HD_Flag
, "Time"
, "TV Show"
, Date(Today(1))&'%'&'$(vChannelID)'&'%'&[TV Show]&'%'&"Time" as Key
FROM [$(vURL)]
(html, codepage is 28591, embedded labels, table is @1);
Next i
What would be the best way to write a loop to, if fails, repeat the attempt to access the html?
I will therefore be able to iterate through each row and if fail, retry?
Apologies for the difficult question but it has been bugging me!