Created
November 4, 2019 15:17
-
-
Save agileguy/a3df320ac369810b18c68dec61636a5f to your computer and use it in GitHub Desktop.
PowerShell script to scrape the location of the MV Quinsam
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$url = 'https://www.vesselfinder.com/vessels/QUINSAM-IMO-8111386-MMSI-316001266' | |
$ie = New-Object -com internetexplorer.application | |
$ie.navigate($url) | |
while ($ie.Busy -eq $true) { Start-Sleep -Milliseconds 100; } | |
$tables = $ie.Document.body.getElementsByClassName('tparams') | |
foreach ($table in $tables) { | |
if ($table.innerHtml -like '*Coordinates*'){ | |
Write-Output $table.rows[$table.rows.length -1].lastChild.innerText | |
Write-Output $table.rows[$table.rows.length -2].lastChild.innerText | |
Write-Output $table.rows[$table.rows.length -3].lastChild.innerText | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment