def detail_translate_note(self, all_url, itemi):
for url in all_url:
url = self.site_domain + url
print('detail_translate_note url %s' % url)
html_requests = requests.get(url).text.encode('utf-8')
html_response = HtmlResponse(url=url, body=html_requests, headers={'Connection': 'close'})
html_all = Selector(html_response)
itemi['detail_translate_note_text_title'] = html_all.xpath(
'//div[@class="main3"]/div[@class="shileft"]/div[@class="son1"]/h1/text()').extract()
itemi['detail_translate_text'] = html_all.xpath(
'//div[@class="main3"]/div[@class="shileft"]/div[@class="shangxicont"]/p[not(@style)]/descendant-or-self::text()').extract()
item_list_temp = []
for item_list in itemi['detail_translate_text']:
temp = item_list.encode('utf-8')
temp = re.sub(r'\"', "“", temp)
item_list_temp.append(temp)
itemi['detail_translate_text'] = item_list_temp
pass
# ????
评论列表
文章目录