1 | sclass LotteryResult { |
2 | S date; |
3 | L<Int> numbers; |
4 | S jackpot; |
5 | |
6 | [stdToString] |
7 | } |
8 | |
9 | static LotteryResult scrapeLotteryResults(S html) { |
10 | LS tok = htmlTok(html); |
11 | new LotteryResult result; |
12 | result.date = assertNempty("Date", rtagParam datetime(findTag time(tok))); |
13 | LS tokResult = first(findContainerTagWithParams(tok, 'td, class := 'result)); |
14 | result.numbers = map parseInt(joinAll(contentsOfContainerTags(tokResult, 'li))); |
15 | LS tokJackpot = first(findContainerTagWithParams(tok, 'span, class := "jackpot-amount")); |
16 | result.jackpot = dropAllTags_trimJoin(tokJackpot); |
17 | ret result; |
18 | } |
Began life as a copy of #1025908
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1027428 |
Snippet name: | scrapeLotteryResults (old layout) |
Eternal ID of this version: | #1027428/1 |
Text MD5: | d3b37c1fa9249f5fb3c9f56e001b030e |
Author: | stefan |
Category: | javax / html |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-03-19 20:32:25 |
Source code size: | 609 bytes / 18 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 1283 / 1310 |
Referenced in: | [show references] |