本文整理汇总了Python中PixivModel.PixivTags类的典型用法代码示例。如果您正苦于以下问题:Python PixivTags类的具体用法?Python PixivTags怎么用?Python PixivTags使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PixivTags类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testTagsSkipShowcase
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: testTagsSearchPartialLast
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)
示例3: testTagsSearchPartial
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)
示例4: testTagsSkipShowcase
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)
示例5: testTagsSearchExactLast
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)
示例6: testTagsSearchExact
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)
示例7: testTagsSearchExact1
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)
示例8: testTagsSearchExact
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)
示例9: testTagsSearchPartial
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)
示例10: testTagsSearchPartialLast
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)
示例11: testTagsMemberSearchLast
def testTagsMemberSearchLast(self):
path = './test/test-tags-member-search-last.htm'
p = open(path, 'r')
page = BeautifulSoup(p.read())
image = PixivTags()
image.parseMemberTags(page, 313631)
# self.assertEqual(len(image.itemList), 10)
self.assertEqual(image.itemList[-1].imageId, 1804545)
self.assertEqual(image.isLastPage, True)
示例12: testTagsMemberSearchLast
def testTagsMemberSearchLast(self):
br = Browser()
path = 'file:///' + os.path.abspath('./test/test-tags-member-search-last.htm').replace(os.sep,'/')
p = br.open(path, 'r')
page = BeautifulSoup(p.read())
image = PixivTags()
image.parseMemberTags(page)
##self.assertEqual(len(image.itemList), 10)
self.assertEqual(image.itemList[-1].imageId, 1804545)
self.assertEqual(image.isLastPage, True)
示例13: testTagsSearchParseDetails
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)
示例14: testTagsMemberSearch
def testTagsMemberSearch(self):
path = './test/test-tags-member-search.htm'
p = open(path, 'r')
page = BeautifulSoup(p.read())
image = PixivTags()
image.parseMemberTags(page, 313631)
self.assertEqual(len(image.itemList), 40)
# self.assertEqual(image.itemList[0].imageId, 53977340)
# self.assertEqual(image.itemList[19].imageId, 45511597)
self.assertEqual(image.isLastPage, False)
self.assertEqual(image.availableImages, 73)
示例15: testTagsSearchParseDetails
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)