【问题标题】:PowerShell Invoke-WebRequest uncorrect results with the parameter page for BoursoramaPowerShell Invoke-WebRequest 结果不正确,Boursorama 的参数页面
【发布时间】:2017-11-27 18:33:21
【问题描述】:

我正在尝试从 boursorama 网站获取数据,但是当我发送带有参数“page”的请求时,如果 page = 1 或 page = 50,结果是相同的。

网址如下:http://www.boursorama.com/bourse/derives/turbos/

我的目标是获取名为“Rechercher des Turbos, Call ou Put”的 webpart 中的产品列表。

以下是请求:

$Data = Invoke-WebRequest -Method Post -URI "http://www.boursorama.com/ajax/ui/refresh.phtml/boursorama/block/bourse/derives/search/turbos?page=30" -Headers @{"X-Brs-Xhr-Request"="true";"X-Requested-With" = "XMLHttpRequest"} -body "parameters[page]=30&class=Boursorama_Block_Bourse_Derives_Search_Turbos"

$Data.content

【问题讨论】:

    标签: powershell


    【解决方案1】:

    不确定,但你可以试试:

    $r=iwr http://www.boursorama.com/bourse/derives/turbos/?page=30
    $r.ParsedHtml.getElementsByTagName('td') |?{$_.classname -eq 'tdv-isin'} |select innerHTML
    

    【讨论】:

    • 你知道如何将innerhtml对象转换成字符串吗?
    • 试试select -expand innerHTML
    • 过滤器页面有效,但 ssjacent=ACCOR 等其他过滤器无效
    猜你喜欢
    • 2020-03-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多