如何连接数据以使我的代码类似于 US-NJ-Camden:
def parse_items(self, response):
hxs = HtmlXPathSelector(response)
loc_Con = hxs.select('/tr/td[2]/span/span/span') #for country
loc_Reg = hxs.select('/tr/td[2]/span/span') #for region
loc_Loc = hxs.select('//tr[3]/td[2]/span/span') #for local
items = []
for titles in titles:
item = somethingItem()
item ["country"] = loc_Con.select('text()').extract()
item ["region"] = loc_Reg.select('text()').extract()
item ["location"] = loc_Loc.select('text()').extract()
item ["code"] = #["country"]-item ["region"]-item ["location"] like the above example