我想收到回复......
<span id="BusinessDbaName" class="dataItem">TECHNO COATINGS INC</span>
scrapy正在返回...
******name = [u'<span id="BusinessDbaName" class="dataItem"></span>']
即。我正在返回html而不是标签中的内容。
问题:导致这种情况的原因,以及如何解决?
这是我的源代码:
import scrapy
class lniSpider(scrapy.Spider):
name = "lni"
allowed_domains = ["secure.lni.wa.gov"]
start_urls = [
"https://secure.lni.wa.gov/verify/Detail.aspx?UBI=602123234&SAW="
]
def parse(self, response):
for sel in response.xpath('//body'):
name = sel.xpath('//*[@id="BusinessDbaName"]').extract()
print ("******name = "), name