I'm using scrapy to crawl this link:
<input class="xxxmail" type="text" readonly="readonly" value="xxx.org">
I just need the "xxx.org". How do I retrieve it?
I'm using scrapy to crawl this link:
<input class="xxxmail" type="text" readonly="readonly" value="xxx.org">
I just need the "xxx.org". How do I retrieve it?
You can use the following xpath expression:
//input[@class="xxxmail"]/@value
This will get the value attribute of an input tag with the "xxxmail" class.
In the spider, you should first instantiate the Selector and then extract() from the xpath:
sel = Selector(response)
print sel.xpath('//input[@class="xxxmail"]/@value').extract()