i am trying to parse the following code, but the javascript fails me ..
<span>
<span class="contributorNameTrigger"><a href="/Nikolai-Shevchuk/e/B003Y0SWPS/ref=ntt_athr_dp_pel_1" id="contributorNameTriggerB003Y0SWPSB0032JT11K" asin="B003Y0SWPSB0032JT11K">Nikolai Shevchuk</a>
<a href="#" asin="B003Y0SWPSB0032JT11K"><span style="margin-left:5px;" class="contributorChevron"><span class="swSprite s_chevron"></span></span></a></span>
<span class="byLinePipe">(Author)</span>
</span>
and between is <a href="#" and <span class="byLinePipe"> is the following javascript code
<input type="hidden" value="B003Y0SWPS" id="contributorASINB003Y0SWPSB0032JT11K">
<span style="display:none"></span>
<script type="text/javascript">
amznJQ.onReady('bylinePopover', function () {});
</script
i have submited the complete code on codepad
the xpath query i am trying is..
$xpath_auth->query('//span/span[@class="contributorNameTrigger"]/text()
the script runs and fails me in getting the author name
[Nikolai Shevchuk ]
, and returns blank
How can i avoid it ,,,,
I see no
divin the code you have given.I would have thought just
//span[@class="contributorNameTrigger"]would have been enough, then you can get thetextContentof the node.