다음과 같은 HTML 구조가 있습니다. DOM 내에 이러한 태그가 많이 있기 때문에 두 번째 색상 다이제스트 요소를 추출하는 강력한 방법을 구축하려고합니다.
<table>
<tbody>
<tr bgcolor="#AAAAAA">
<tr>
<tr>
<tr>
<tr>
<td>Color Digest </td>
<td>AgArAQICGQMVBBwTIRQHIwg0GUMURAZTBWQJcwV0AoEDAQ </td>
</tr>
<tr>
<td>Color Digest </td>
<td>2,43,2,25,21,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, </td>
</tr>
</tbody>
</table>
디코딩 된 값이있는 두 번째 "Color Digest"td 요소를 추출하려고합니다.
다음 xpath를 작성했지만 두 번째를 얻는 대신 두 번째 td 요소를 얻지 못했습니다.
//td[text() = ' Color Digest ']/following-sibling::td[2]
그리고 그것을 td [2]에서 td [1]로 변경하면 두 요소를 모두 얻습니다.