HTMLXPathSelector を使用して HTML コンテンツを解析しています。また、ターゲット Web サイトにはランダムな HTML タグがあります。例: その形式は次のとおりです。
<div class="doctor_ans">
<h3>Title</h3>
<p style="text-align: justify;">
<span style="font-size: 12px;">
<span style="font-family: arial,helvetica,sans-serif;">
<font color="#000000">I would like to get contain here.</font>
</span>
</span>
</p>
</div>
また
<div class="doctor_ans">
<h3>Title</h3>
<p style="text-align: justify;">
<span style="font-size: 12px;">
<span style="font-family: arial,helvetica,sans-serif;">
I would like to get contain here.>
</span>
</span>
</p>
</div>
また
<div class="doctor_ans">
<h3>Title</h3>
<p>
<span style="font-size: 12px;">
<span style="font-family: arial,helvetica,sans-serif;">
<font color="#000000">I would like to get contain here.</font>
</span>
</span>
</p>
</div>
また
<div class="doctor_ans">
<h3>Title</h3>
<p>
<span style="font-size: 12px;">
I would like to get contain here.
</span>
</p>
</div>
等々。
このコンテンツを解析する方法についてアドバイスをください。HTML タグはランダムに発生します。したがって、最後の要素を見つけるために子要素を取得するメソッドが必要です。