class Post(Item): title = Css('.entry-title') content = Css('.entry-content') regex_test = Regex('\d+') async def save(self): print(self.title, '\n')
class Post(Item): title = Css('.entry-title') content = Css('.entry-content') async def save(self): with open('scrapinghub.txt', 'a+') as f: f.writelines(self.results['title'] + '\n')
class Post(Item): title = Css('.entry-title') content = Css('.entry-content') regex_test = Regex('\d+') async def save(self): async with aiofiles.open('scrapinghub.txt', 'a+') as f: await f.write(str(self.results))
class Post(Item): title = Css('.entry-title') print(title) content = Css('.entry-content') print(content) async def save(self): async with aiofiles.open('scrapinghub.txt', 'a+') as f: await f.write(self.results['title'])
class Post(Item): title = Css('.entry-header h1::text') async def save(self): print(str(self.results))
class User(Item): username = Xpath('//title') karma = Css('.karma')
class User(Item): username = Css('.username') karma = Xpath('//[@class=karma]')
class Post(Item): title = Css('h1') async def save(self): print(self.title)
class Post(Item): i = Css('input') async def save(self): print(self.i)
class Post(Item): title = Css('.breadcrumb_last') async def save(self): print(self.title)