我正在嘗試使用powershell從microsoft網(wǎng)頁獲取內容。鏈接的鏈接位于-https://learn.microsoft.com/en-us/lifecycle/products/?products=windows
下方。
主要目標是使用powershell從結果窗口中取出“Windows Server 2022”的可用鏈接ahref標記。
使用invoke-webrequest
有幫助,但只能獲取頁腳和頁眉。也在嘗試獲取結果。
我正在嘗試使用powershell從microsoft網(wǎng)頁獲取內容。鏈接的鏈接位于-https://learn.microsoft.com/en-us/lifecycle/products/?products=windows
下方。
主要目標是使用powershell從結果窗口中取出“Windows Server 2022”的可用鏈接ahref標記。
使用invoke-webrequest
有幫助,但只能獲取頁腳和頁眉。也在嘗試獲取結果。
公眾號:1024技術圈
?? 提供互聯(lián)網(wǎng)知識和資訊,分享IT前沿技術,熱門資源,大廠面試題 ??
該頁面上的結果在頁面完成加載后使用對搜索服務的異步調用進行調用和加載。
看了DevTools(F12)后,我可以看到要使用哪個調用:
有了這些信息,在PowerShell中運行相同的搜索非常容易:
答案是:
您可能需要將前導
https://learn.microsoft.com/en-us/
添加到url
屬性中,因為它不包括在響應負載中。