I'm trying to retrieve all the url's from within the anchor tags. I have used the query response.selector.xpath('//li[@class="active"]//a/@href').extract()
,
to extract all the url's, but I only get a few queries.
The web page is structured as :
`<ul class="data">
<li id="all" class="active">
<a class="fit" href="#1"></a>
<div class="1">
<a target="_blank" href="www.yahoo.com">
</div>
<div class="2">
<a target="_blank" href="www.google.com">
</div>
<a class="fit" xmlns:listval="com.indiatimes.cms.utilities.CMSDateUtility" xmlns:java="java" href="#2"></a>
<div class="1">
<a target="_blank" href="www.facebook.com">
</div>
<div class="2">
<a target="_blank" href="www.bing.com">
</div>
<a class="fit" xmlns:listval="com.indiatimes.cms.utilities.CMSDateUtility" xmlns:java="java" href="#3"></a>
<div class="1">
<a target="_blank" href="www.amazon.com">
</div>
<div class="2">
<a target="_blank" href="www.flipkart.com">
</div>
<a class="fit" xmlns:listval="com.indiatimes.cms.utilities.CMSDateUtility" xmlns:java="java" href="#4"></a>
<div class="1">
<a target="_blank" href="www.snapdeal.com">
</div>
<div class="2">
<a target="_blank" href="www.infibeam.com">
</div>
</li>
</ul>`
The previous query fetches me only "www.yahoo.com" and "www.google.com". What tweak do I need to do to get all the href's ?