예제 #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')
예제 #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')
예제 #3
0
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))
예제 #4
0
파일: test_parser.py 프로젝트: yougecn/work
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'])
예제 #5
0
class Post(Item):
    title = Css('.entry-header h1::text')

    async def save(self):
        print(str(self.results))
예제 #6
0
파일: test_parser.py 프로젝트: raj347/gain
 class User(Item):
     username = Xpath('//title')
     karma = Css('.karma')
예제 #7
0
 class User(Item):
     username = Css('.username')
     karma = Xpath('//[@class=karma]')
예제 #8
0
class Post(Item):
    title = Css('h1')

    async def save(self):
        print(self.title)
예제 #9
0
class Post(Item):
    i = Css('input')

    async def save(self):
        print(self.i)
예제 #10
0
class Post(Item):
    title = Css('.breadcrumb_last')

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