Saving a web page from IE using Powershell

前端 未结 1 376
天命终不由人
天命终不由人 2021-01-14 01:56

I use the automation interface of Internet Explorer from Powershell to open a web page in a supported format. I want to save this page back to disk in one of the formats sup

1条回答
  •  余生分开走
    2021-01-14 02:03

    You want to call ExecWB with the appropriate args:

    $ie.ExecWB(4,0,$null,[ref]$null)
    

    Explanation of the 4 params:

    4 = OLECMDID_SAVEAS
    0 = OLECMDEXECOPT_DODEFAULT (This can also be 2 = OLECMDEXECOPT_DONTPROMPTUSER to not prompt and just save)
    $null = NULL (I think this can be a path to save to: separate folders with 2 slashes (\\))
    [ref]$null = ref NULL :)
    

    0 讨论(0)
提交回复
热议问题