invoke-webrequest获取包含图像的完整网页 [英] invoke-webrequest to get complete web page with images
本文介绍了invoke-webrequest获取包含图像的完整网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何让输出文件包含网页上的图像,而不仅仅是图像的链接?
How do I get the output file to contain the images on the webpage and not just the links to the images?
PS C: \temp> Invoke-WebRequest http://mitpress.mit.edu/sites/default/files/titles/content/sicm/book-ZH-51.html -OutFile C:\ temp\51.html
推荐答案
您需要浏览一下页面以找出一些细节。这是一个我已成功测试过的完整脚本。
You need to explore the page a bit to figure out some of details. Here's a complete script which I've tested successfully.
Invoke-WebRequest http://mitpress.mit.edu/sites/default/files/titles/content/sicm/book-Z-H-51.html |
select -expand images |
select -expand src |
foreach { start-bitstransfer $("http://mitpress.mit.edu/sites/default/files/titles/content/sicm/{0}" -f $_) C:\Users\Public\Downloads}
这篇关于invoke-webrequest获取包含图像的完整网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文