(host: string)
| 46 | } |
| 47 | |
| 48 | async function findIp(host: string) { |
| 49 | const url = resolveUrl(host); |
| 50 | |
| 51 | const response = await fetch(url, { |
| 52 | headers: headers |
| 53 | }); |
| 54 | const htmlText = await response.text(); |
| 55 | |
| 56 | const $ = cheerio.load(htmlText); |
| 57 | |
| 58 | const ipList: string[] = []; |
| 59 | |
| 60 | $('#dnsinfo>tr') |
| 61 | .each((i, element) => { |
| 62 | let td = $(element).children(); |
| 63 | |
| 64 | if ($(td[1]).text() === 'A') { |
| 65 | ipList.push($(element) |
| 66 | .children() |
| 67 | .last() |
| 68 | .text()); |
| 69 | } |
| 70 | }); |
| 71 | |
| 72 | return ipList; |
| 73 | } |
| 74 | |
| 75 | async function findIpWrapper(host: string) { |
| 76 | let retryCount = 3; |
no test coverage detected