MCPcopy
hub / github.com/mvdctop/Movie_Data_Capture / getUserVotes

Method getUserVotes

scrapinglib/parser.py:279–284  ·  view source on GitHub ↗
(self, htmltree)

Source from the content-addressed store, hash-verified

277 return ''
278
279 def getUserVotes(self, htmltree):
280 votestrs = self.getTreeElement(htmltree, self.expr_uservotes)
281 votes = re.findall('[0-9]+', votestrs)
282 if len(votes) == 1:
283 return int(votes[0])
284 return ''
285
286 def getTreeElement(self, tree: html.HtmlElement, expr, index=0):
287 """ 根据表达式从`xmltree`中获取匹配值,默认 index 为 0

Callers 1

dictformatMethod · 0.95

Calls 1

getTreeElementMethod · 0.95

Tested by

no test coverage detected