Beispiel #1
0
class Post(Item):
    title = Css('.entry-title')
    content = Css('.entry-content')
    regex_test = Regex('\d+')

    async def save(self):
        print(self.title, '\n')
Beispiel #2
0
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))
Beispiel #4
0
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'])
Beispiel #5
0
class Post(Item):
    title = Css('.entry-header h1::text')

    async def save(self):
        print(str(self.results))
Beispiel #6
0
 class User(Item):
     username = Xpath('//title')
     karma = Css('.karma')
Beispiel #7
0
 class User(Item):
     username = Css('.username')
     karma = Xpath('//[@class=karma]')
Beispiel #8
0
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)
Beispiel #10
0
class Post(Item):
    title = Css('.breadcrumb_last')

    async def save(self):
        print(self.title)