0
$xpath = new DOMXpath($doc)
を使用すると、のアンカーの下に置かれた場合は、div
(およびその子)を取得できませんでした。 XPathのでXPath:アンダーアンダー
:
html[1]/body[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/a[1]/div[1]/div[2]/div[1]/div[2]/img[1]
私はbody
から始まる一つの要素のいずれかを評価し、私はアンカーに達したときに、それを読み取ることができたXPathの最後のタグでした。
ブロック要素をアンカーに配置するのはベストプラクティスではありませんが、このhtmlページは私のものではなく、変更できません。
これを取得する方法はありますか?
.....<div class="main-image">
<a title="" style="outline-style: none; text-decoration: none;" class="jqzoom" rel="gallery1" data-active="1" href="files/product/images/239_image_raw.jpg">
<div class="zoomPad">
<img style="opacity: 1;" title="" src="files/product/images/239_image.jpg" alt="ABSOLUTE SUMMER 8 VITA BASSA" height="320" width="240">
<div style="top: 97.6167px; left: 80px; width: 148px; height: 153px; position: absolute; border-width: 1px; display: none;" class="zoomPup"></div>
<div style="position: absolute; z-index: 5001; left: 239px; top: 0px; display: none;" class="zoomWindow">
<div style="width: 312px;" class="zoomWrapper"><div style="width: 100%; position: absolute; display: none;" class="zoomWrapperTitle"></div>
<div style="width: 100%; height: 320px;" class="zoomWrapperImage">
<img src="files/product/images/239_image_raw.jpg" style="position: absolute; border: 0px none; display: block; left: -169.782px; top: -206.257px;">.....