Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: Downloading Tables from webpages

$
0
0

ok I Have got the following:

$ie = New-Object -com “InternetExplorer.Application”
$ie.navigate(“http://www.google.co.uk”)
$doc = $ie.Document
($doc.getElementsByTagName(“table”))|%{$_.innerText} | Out-File C:\Output.txt

$Red = Select-String C:\Output.txt -pattern “Red”
$Yellow = Select-String C:\Output.txt -pattern “Yellow”

If(Select-String C:\Output.txt -pattern “Email and OWA”){
$Service = Select-String C:\Output.txt -pattern “Email and OWA”
$Test = $Service -split(“Green”)
$Test
$Test[0]
$Test[1]
$Test[2]
}

Which essentially dumps the table with no formatting into a text file and I am trying to sort out the information. However there are no spaces or anything between the columns of the table which makes things difficult.

An extract of the information as shown is here:

Email and OWAPlanned maintanance affecting external emailsGreenPlease be aware that on Wednesday the 31st July and Wednesday 7th August there will be interruptions to
external e-mail flowing in and out of the organisation.
The service will stop at 5.30pm and may be down until 9.00pm.

Can anyone give any idea’s on this?

Many Thanks

James


Viewing all articles
Browse latest Browse all 13067

Trending Articles