I am use the following xpath selector within the parse method of a scrapy spider
for item in response.xpath(
'//div[@id="mosaic-provider-jobcards"]//a//*[boolean(@id)]'
):
print(item.get())
This works and returns the following text for each item extracted
<span title="bla bla bla" id="1211">sdsd</span>
Within in the loop I now want to extract title and id (i.e. bla bla bla and 1211), I attempted the following code but this is not working
for item in response.xpath(
'//div[@id="mosaic-provider-jobcards"]//a//*[boolean(@id)]'
):
print(direct_page.xpath(".//title").get())
This returning None, I want it to return the title for every span, What am I doing wrong?