Try:

hs.xpath(".//span[@class = 'titlelink']/a*//*text()").extract()


Best Regards.
Lhassan.


2015-07-23 18:52 GMT+01:00 SreeSindhu Sruthi <[email protected]>:

> 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 some output
>
> where as
> item["title"] = hs.xpath(".//span[@class =
> 'titlelink']/a/text()").extract() results in empty list.
>
> extract doesn;t give all the list.
>
> Please help me how to fix this.
>
>
> On Thursday, July 23, 2015 at 1:33:03 PM UTC+5:30, SreeSindhu Sruthi wrote:
>>
>> How to use contains for an attribute of a tag using xpath in scrapy
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "scrapy-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/scrapy-users.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"scrapy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/scrapy-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to