I am trying to use XPath to get elements on a page which reside within a <script> tag. For example:
<div id="foo">
<script>
<p>You can't get me.</p>
</script>
</div>
If I try response.xpath('//div[@id="foo"]//p') or response.xpath('//div[@id="foo"]/script/p'), both return an empty array.
How can I get the elements within the <script> tag using XPath?