```
<div id="something">
    <a id="dd_start">
    <p>A</p
    <h2>B</h2>
    <p>C</p>
    <h5>D</h5>
    <script> </script>
    <p>E</p>
    <div></div>
</div>

```

How to get all the elements before the last `p`? I want `p`, `h2`, `p`, and `h5`: A B C D.

I tried:

```
item['contents'] = ' '.join(response.xpath('//*[@id="something"]/preceding-sibling::*p//text()').extract()).strip()

item['contents'] = ' '.join(response.xpath('//*[@id="something"]/preceding-sibling::p[last()]//text()').extract()).strip()

item['contents'] = ' '.join(response.xpath('//*[@id="something"]/p[last()]/preceding-sibling::*//text()').extract()).strip()

```

can't seem to work. My content always return empty.