text() is not working in scrapy

27 views
Skip to first unread message

SreeSindhu Sruthi

unread,
Jul 23, 2015, 8:18:29 AM7/23/15
to scrapy-users

Consider this as, part of html code that is available
<span class = "titlelink"> 
       <a id = "xyz" onclick= "abc" href="#" title = "View this job description"> Associate
        </a> 
</span>

In my spider file ,

item["title"] = hs.xpath(".//span[@class = 'titlelink']/a/").extract() gives me the output 

where as 
item["title"] = hs.xpath(".//span[@class = 'titlelink']/a/text()").extract() results in empty list.

SreeSindhu Sruthi

unread,
Jul 23, 2015, 8:35:21 AM7/23/15
to scrapy-users, sss...@gmail.com
and .extract() is not giving all the list of the values available  it only returns one value.
Reply all
Reply to author
Forward
0 new messages