本文整理汇总了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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)