Want to download web url content

Welcome Forums General PowerShell Q&A Want to download web url content

This topic contains 2 replies, has 2 voices, and was last updated by

10 months, 1 week ago.

  • Author
  • #101001

    Points: 0
    Rank: Member

    Hi All,

    I have one url and I want to download the all web url content and copy it to some text file but unable to do so. That URL have username and password as well so please guide how to do this. Do I need to pass credentials also in script. If yes, then how. Any insight would be appreciated.

    Till now code is –

    Invoke-WebRequest -Uri abc.com/#/queues -Credential "guest"
    $WebClient = New-Object System.Net.WebClient

    but on executed it's not giving the desired result. It's not copying the web page.


  • #101013

    Points: 459
    Helping Hand
    Rank: Contributor

    A brief illustration:

    $Cred = Get-Credential
    $Webclient.Credentials = $Cred

    Personally I find this stuff a bit easier with the built in Invoke-WebRequest cmdlet, but either works, really. 🙂

    • #101041

      Points: 0
      Rank: Member

      Hi Joel,

      Thanks for replying but I have already tried this via google but didn't get the actual result. The issue is on web url there is a tab of "get-message" and after clicking on that tab the result will show. In my case i think i have to call the "get-message" tab in script and after that only then the result will come so do you have any idea that how to do this?

      Thanks in advance

The topic ‘Want to download web url content’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort