<div class="ContainerFieldControlHoriz" style="width: 400px;">
<label title="Who was your first employer?" id="dnn_ctr1854_ChallengeQuestion_ChallengeQuestionCmnTextBox_ControlLabel">Who was your first employer?</label>
</div>
我的代码是
Set htmlsecurityquestion = htmldoc.getElementById("dnn_ctr1854_ChallengeQuestion_ChallengeQuestionCmnTextBox_ControlLabel")
Range("A1").Value = htmlsecurityquestion.innerText
但它不起作用
答案 0 :(得分:0)
您可以通过属性集合访问此值,而不是通过innerText
。你的第二行应该是:
Range("A1").Value = htmlsecurityquestion.Attributes["title"].Value;