예제 #1
0
class Post(Item):
    quote = Xpath("//span[@class = 'text']")
    author = Xpath("//small")

    async def save(self):
        quote = dict(zip(self.author, self.quote))
        assert quote['Albert Einstein'] == '“Try not to become a man of success. Rather become a man of value.”'
예제 #2
0
파일: test_parser.py 프로젝트: raj347/gain
 class User(Item):
     username = Xpath('//title')
     karma = Css('.karma')
예제 #3
0
 class User(Item):
     username = Css('.username')
     karma = Xpath('//[@class=karma]')