当前位置: 首页>>代码示例>>Python>>正文


Python PixivTags.parseTags方法代码示例

本文整理汇总了Python中PixivModel.PixivTags.parseTags方法的典型用法代码示例。如果您正苦于以下问题:Python PixivTags.parseTags方法的具体用法?Python PixivTags.parseTags怎么用?Python PixivTags.parseTags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PixivModel.PixivTags的用法示例。


在下文中一共展示了PixivTags.parseTags方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testTagsSkipShowcase

# 需要导入模块: from PixivModel import PixivTags [as 别名]
# 或者: from PixivModel.PixivTags import parseTags [as 别名]
    def testTagsSkipShowcase(self):
        path = './test/test-tags-search-skip-showcase.htm'
        p = open(path, 'r')
        page = BeautifulSoup(p.read())
        image = PixivTags()
        image.parseTags(page)

        self.assertEqual(len(image.itemList), 40)
开发者ID:Nandaka,项目名称:PixivUtil2,代码行数:10,代码来源:test_PixivModel.py

示例2: testTagsSkipShowcase

# 需要导入模块: from PixivModel import PixivTags [as 别名]
# 或者: from PixivModel.PixivTags import parseTags [as 别名]
    def testTagsSkipShowcase(self):
        br = Browser()
        path = 'file:///' + os.path.abspath('./test/test-tags-search-skip-showcase.htm').replace(os.sep,'/')
        p = br.open(path, 'r')
        page = BeautifulSoup(p.read())
        image = PixivTags()
        image.parseTags(page)

        self.assertEqual(len(image.itemList), 20)
开发者ID:EvilNeo,项目名称:PixivUtil2,代码行数:11,代码来源:test.PixivModel.py

示例3: testTagsSearchPartialLast

# 需要导入模块: from PixivModel import PixivTags [as 别名]
# 或者: from PixivModel.PixivTags import parseTags [as 别名]
    def testTagsSearchPartialLast(self):
        path = './test/test-tags-search-partial-last.htm'
        p = open(path, 'r')
        page = BeautifulSoup(p.read())
        image = PixivTags()
        image.parseTags(page)

        self.assertEqual(image.itemList[-1].imageId, 15060554)
        self.assertEqual(image.isLastPage, True)
开发者ID:Nandaka,项目名称:PixivUtil2,代码行数:11,代码来源:test_PixivModel.py

示例4: testTagsSearchPartial

# 需要导入模块: from PixivModel import PixivTags [as 别名]
# 或者: from PixivModel.PixivTags import parseTags [as 别名]
    def testTagsSearchPartial(self):
        path = './test/test-tags-search-partial.htm'
        p = open(path, 'r')
        page = BeautifulSoup(p.read())
        image = PixivTags()
        image.parseTags(page)

        self.assertEqual(len(image.itemList), 40)
        self.assertEqual(image.isLastPage, False)
开发者ID:Nandaka,项目名称:PixivUtil2,代码行数:11,代码来源:test_PixivModel.py

示例5: testTagsSearchPartialLast

# 需要导入模块: from PixivModel import PixivTags [as 别名]
# 或者: from PixivModel.PixivTags import parseTags [as 别名]
    def testTagsSearchPartialLast(self):
        br = Browser()
        path = 'file:///' + os.path.abspath('./test/test-tags-search-partial-last.htm').replace(os.sep,'/')
        p = br.open(path, 'r')
        page = BeautifulSoup(p.read())
        image = PixivTags()
        image.parseTags(page)

        self.assertEqual(image.itemList[-1].imageId, 15060554)
        self.assertEqual(image.isLastPage, True)
开发者ID:EvilNeo,项目名称:PixivUtil2,代码行数:12,代码来源:test.PixivModel.py

示例6: testTagsSearchPartial

# 需要导入模块: from PixivModel import PixivTags [as 别名]
# 或者: from PixivModel.PixivTags import parseTags [as 别名]
    def testTagsSearchPartial(self):
        br = Browser()
        path = 'file:///' + os.path.abspath('./test/test-tags-search-partial.htm').replace(os.sep,'/')
        p = br.open(path, 'r')
        page = BeautifulSoup(p.read())
        image = PixivTags()
        image.parseTags(page)

        self.assertEqual(len(image.itemList), 20)
        self.assertEqual(image.isLastPage, False)
开发者ID:EvilNeo,项目名称:PixivUtil2,代码行数:12,代码来源:test.PixivModel.py

示例7: testTagsSearchExact

# 需要导入模块: from PixivModel import PixivTags [as 别名]
# 或者: from PixivModel.PixivTags import parseTags [as 别名]
    def testTagsSearchExact(self):
        br = Browser()
        path = "file:///" + os.path.abspath("./test/test-tags-search-exact.htm").replace(os.sep, "/")
        p = br.open(path, "r")
        page = BeautifulSoup(p.read())
        image = PixivTags()
        image.parseTags(page)

        self.assertEqual(len(image.itemList), 20)
        self.assertEqual(image.isLastPage, False)
开发者ID:yife,项目名称:PixivUtil2,代码行数:12,代码来源:test.PixivModel.py

示例8: testTagsSearchExactLast

# 需要导入模块: from PixivModel import PixivTags [as 别名]
# 或者: from PixivModel.PixivTags import parseTags [as 别名]
    def testTagsSearchExactLast(self):
        path = './test/test-tags-search-exact-last.htm'
        p = open(path, 'r')
        page = BeautifulSoup(p.read())
        image = PixivTags()
        image.parseTags(page)

        print(image.itemList[-1])
        self.assertEqual(image.itemList[-1].imageId, 544700)
        self.assertEqual(image.isLastPage, True)
开发者ID:Nandaka,项目名称:PixivUtil2,代码行数:12,代码来源:test_PixivModel.py

示例9: testTagsSearchExact

# 需要导入模块: from PixivModel import PixivTags [as 别名]
# 或者: from PixivModel.PixivTags import parseTags [as 别名]
    def testTagsSearchExact(self):
        path = './test/test-tags-search-exact.htm'
        p = open(path, 'r')
        page = BeautifulSoup(p.read())
        image = PixivTags()
        image.parseTags(page)
##        for img in image.itemList:
##            print(img.imageId)
        self.assertEqual(len(image.itemList), 40)
        self.assertEqual(image.isLastPage, False)
开发者ID:Nandaka,项目名称:PixivUtil2,代码行数:12,代码来源:test_PixivModel.py

示例10: testTagsSearchExact1

# 需要导入模块: from PixivModel import PixivTags [as 别名]
# 或者: from PixivModel.PixivTags import parseTags [as 别名]
    def testTagsSearchExact1(self):
        path = './test/test-tags-search-exact2.htm'
        p = open(path, 'r')
        page = BeautifulSoup(p.read())
        image = PixivTags()
        image.parseTags(page)

        self.assertEqual(len(image.itemList), 40)
        self.assertEqual(image.isLastPage, False)
        self.assertEqual(image.availableImages, 2283)
开发者ID:Nandaka,项目名称:PixivUtil2,代码行数:12,代码来源:test_PixivModel.py

示例11: testTagsSearchParseDetails

# 需要导入模块: from PixivModel import PixivTags [as 别名]
# 或者: from PixivModel.PixivTags import parseTags [as 别名]
    def testTagsSearchParseDetails(self):
        path = './test/test-tags-search-exact-parse_details.htm'
        p = open(path, 'r')
        page = BeautifulSoup(p.read())
        image = PixivTags()
        image.parseTags(page)

        # self.assertEqual(len(image.itemList), 20)
        self.assertEqual(image.itemList[-1].imageId, 33815932)
        self.assertGreater(image.itemList[-1].bookmarkCount, 4)
        self.assertEqual(image.itemList[-1].imageResponse, 0)
开发者ID:Nandaka,项目名称:PixivUtil2,代码行数:13,代码来源:test_PixivModel.py

示例12: testTagsSearchParseDetails

# 需要导入模块: from PixivModel import PixivTags [as 别名]
# 或者: from PixivModel.PixivTags import parseTags [as 别名]
    def testTagsSearchParseDetails(self):
        br = Browser()
        path = 'file:///' + os.path.abspath('./test/test-tags-search-exact-parse_details.htm').replace(os.sep,'/')
        p = br.open(path, 'r')
        page = BeautifulSoup(p.read())
        image = PixivTags()
        image.parseTags(page)

        ##self.assertEqual(len(image.itemList), 20)
        self.assertEqual(image.itemList[-1].imageId, 33815932)
        self.assertEqual(image.itemList[-1].bookmarkCount, 4)
        self.assertEqual(image.itemList[-1].imageResponse, 0)
开发者ID:EvilNeo,项目名称:PixivUtil2,代码行数:14,代码来源:test.PixivModel.py

示例13: testTagsSearchPartial

# 需要导入模块: from PixivModel import PixivTags [as 别名]
# 或者: from PixivModel.PixivTags import parseTags [as 别名]
 def testTagsSearchPartial(self):
     br = Browser()
     path = 'file:///' + os.path.abspath('./test/test-tags-search-partial.htm').replace(os.sep,'/')
     p = br.open(path, 'r')
     page = BeautifulSoup(p.read())
     image = PixivTags()
     image.parseTags(page)
     
     self.assertEqual(len(image.itemList), 20)
     self.assertEqual(image.itemList[0].imageId, 27792358)
     self.assertEqual(image.itemList[0].bookmarkCount, 2)
     self.assertEqual(image.itemList[0].imageResponse, -1)
     self.assertEqual(image.itemList[19].imageId, 27110688)
     self.assertEqual(image.itemList[19].bookmarkCount, -1)
     self.assertEqual(image.itemList[19].imageResponse, -1)
     self.assertEqual(image.isLastPage, False)
开发者ID:Hakus,项目名称:PixivUtil2,代码行数:18,代码来源:test.PixivModel.py

示例14: testTagsSearchExactLast

# 需要导入模块: from PixivModel import PixivTags [as 别名]
# 或者: from PixivModel.PixivTags import parseTags [as 别名]
    def testTagsSearchExactLast(self):
        br = Browser()
        path = 'file:///' + os.path.abspath('./test/test-tags-search-exact-last.htm').replace(os.sep,'/')
        p = br.open(path, 'r')
        page = BeautifulSoup(p.read())
        image = PixivTags()
        image.parseTags(page)

        self.assertEqual(len(image.itemList), 4)
        self.assertEqual(image.itemList[0].imageId, 21618970)
        self.assertEqual(image.itemList[0].bookmarkCount, -1)
        self.assertEqual(image.itemList[0].imageResponse, -1)
        self.assertEqual(image.itemList[3].imageId, 15060554)
        self.assertEqual(image.itemList[3].bookmarkCount, 1)
        self.assertEqual(image.itemList[3].imageResponse, -1)        
        self.assertEqual(image.isLastPage, True)
开发者ID:Hakus,项目名称:PixivUtil2,代码行数:18,代码来源:test.PixivModel.py

示例15: testTagsSearchParseDetails

# 需要导入模块: from PixivModel import PixivTags [as 别名]
# 或者: from PixivModel.PixivTags import parseTags [as 别名]
 def testTagsSearchParseDetails(self):
     br = Browser()
     path = 'file:///' + os.path.abspath('./test/test-tags-search-exact-parse_details.htm').replace(os.sep,'/')
     p = br.open(path, 'r')
     page = BeautifulSoup(p.read())
     image = PixivTags()
     image.parseTags(page)
     
     self.assertEqual(len(image.itemList), 20)
     ## http://www.pixiv.net/member_illust.php?mode=medium&illust_id=26563564
     self.assertEqual(image.itemList[0].imageId, 26563564)
     self.assertEqual(image.itemList[0].bookmarkCount, 1)
     ## http://www.pixiv.net/member_illust.php?mode=medium&illust_id=26557089
     self.assertEqual(image.itemList[1].imageId, 26557089)
     self.assertEqual(image.itemList[1].bookmarkCount, 3)
     self.assertEqual(image.itemList[1].imageResponse, 14)
     ## http://www.pixiv.net/member_illust.php?mode=medium&illust_id=26538917
     self.assertEqual(image.itemList[5].imageId, 26538917)
     self.assertEqual(image.itemList[5].bookmarkCount, -1)
     self.assertEqual(image.itemList[5].imageResponse, -1)
开发者ID:Hakus,项目名称:PixivUtil2,代码行数:22,代码来源:test.PixivModel.py


注:本文中的PixivModel.PixivTags.parseTags方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。