[PowerShell]HTML parsing -- get information from a website

link: http://stackoverflow.com/questions/9053573/powershell-html-parsing-get-information-from-a-website

希望能从一个网页里获取一些信息

function Get-FlightStatus {
    param($query)

    $url = "http://bing.com?q=flight status for $query"

    $result = Invoke-WebRequest $url

    $result.AllElements | 
        Where Class -eq "ans" |
        Select -First 1 -ExpandProperty innerText    
}

  

posted @ 2015-12-28 19:15  卜海清  阅读(275)  评论(0编辑  收藏  举报