问题描述
参考下面的编码,我想知道为什么不能将html保存到文本文件中。
Referring to following coding, I would like to know on why not able to save html into text file.
$ ieObject = New-Object -ComObject'InternetExplorer.Application '
$ieObject = New-Object -ComObject 'InternetExplorer.Application'
$ ieObject
$ieObject
$ ieObject.Visible = $ true
$ieObject.Visible = $true
$ ieObject.Navigate(" http://www.hkexnews.hk/index_c.htm")
#$ Doc.body.innerHTML
$ieObject.Navigate("http://www.hkexnews.hk/index_c.htm")
# $Doc.body.innerHTML
$ Doc.body.innerHTML | Out-File" C:\Temp \ HTML.txt"
$ ieObject.Quit()
$Doc.body.innerHTML | Out-File "C:\Temp\HTML.txt"
$ieObject.Quit()
有没有人有任何建议?
提前感谢任何建议
Does anyone have any suggestions?
Thanks in advance for any suggestions
提前感谢任何建议
推荐答案
这篇关于如何编写此PowerShell代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!