(url)
| 50 | .trim(); |
| 51 | |
| 52 | const fetchText = async (url) => { |
| 53 | const response = await fetch(url); |
| 54 | |
| 55 | if (!response.ok) { |
| 56 | throw new Error(`Could not fetch ${url}: ${response.status} ${response.statusText}`); |
| 57 | } |
| 58 | |
| 59 | return response.text(); |
| 60 | }; |
| 61 | |
| 62 | const parseIndex = (html) => { |
| 63 | const itemPattern = /<li><a href="([^"]+)">([\s\S]*?)<\/a>, por ([\s\S]*?)<\/li>/g; |