3 ms·
Prefix the code with spaces to format it: # Without using BeautifulSoup. for item in hxs.select('//td[@class="title"]/a'): news_item = NewsItem()
by d0mine 15y ago
Prefix the code with spaces to format it:
# Without using BeautifulSoup.
for item in hxs.select('//td[@class="title"]/a'):
news_item = NewsItem()
news_item['title'] = item.select('text()').extract()[0]
news_item['url'] = item.select('@href').extract()[0]