This is my PowerShell script.
$geturl = Invoke-WebRequest "https://www.sample.com/"
$li=$geturl.ParsedHtml.body.getElementsByTagName('li') |
Where {$_.getAttributeNode('class').Value -eq 'col-md-6'}
$ip = $li | select OuterText
This is what the script returns:
outerText
---------
179.60.147.106 (1986 reports from 281 distinct users)
195.226.194.242 (1000 reports from 274 distinct users)
195.226.194.142 (957 reports from 260 distinct users)
61.177.173.50 (857 reports from 201 distinct users)
61.177.172.114 (708 reports from 200 distinct users)
61.177.173.36 (869 reports from 199 distinct users)
61.177.173.53 (847 reports from 198 distinct users)
61.177.173.49 (818 reports from 198 distinct users)
39.109.86.40 (287 reports from 197 distinct users)
61.177.172.124 (786 reports from 194 distinct users)
I would like save only IP Addresses to txt file. Is it possible?