0
我想抓取「filterTable」中的第3個「td」元素。這是如何在像Powershell這樣的.NET環境中完成的?我已經嘗試了很多方法,例如:Powershell:如何引用第n個元素
$_.getElementsByTagName("td")[3]
$_.getElementsByTagName("td[3]")
$_.getElementsByTagName("td:3")
$_.getElementsByTagName("td{3}")
$_.getElementsByTagName("td"){3}
但是,這些都不起作用。有沒有辦法做到這一點?謝謝你的幫助。下面是我的代碼一些背景:
$textValues = @()
$textValues = $data.ParsedHtml.getElementById("filterTable") | foreach{
$_.getElementsByTagName("td") | foreach{
$_ | Select InnerText
}
}
什麼用downvotes的? – Quanda