Skip to content

Instantly share code, notes, and snippets.

@agileguy
Created November 4, 2019 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agileguy/a3df320ac369810b18c68dec61636a5f to your computer and use it in GitHub Desktop.
Save agileguy/a3df320ac369810b18c68dec61636a5f to your computer and use it in GitHub Desktop.
PowerShell script to scrape the location of the MV Quinsam
$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