def testMatch(self): item = ldrfullfeed.match(self.data, "http://no.match.url/") self.assertEqual(item["xpath"], "//body") start = time.time() item = ldrfullfeed.match(self.data, "http://douganoyoake.blog18.fc2.com/items") print "SEARCH TIME: " + str((time.time() - start)*1000) + " msec" self.assertEqual(item["xpath"], '//div[(@class="e-text")]')
def testMatch(self): item = ldrfullfeed.match(self.data, "http://no.match.url/") self.assertEqual(item["xpath"], "//body") start = time.time() item = ldrfullfeed.match(self.data, "http://douganoyoake.blog18.fc2.com/items") print "SEARCH TIME: " + str((time.time() - start) * 1000) + " msec" self.assertEqual(item["xpath"], '//div[(@class="e-text")]')
def get_xitem(fetch_url): return ldrfullfeed.match(data, fetch_url)