Guest User

Untitled

a guest
Jan 22nd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. if re.match(r'^/wiki/', link.get("href")) is not None:
  2. wikiArticleName = re.sub(r'^/wiki/', '', link.get("href"))
  3. css = link.get("class", "")
  4. css += " aptureWikiInternal"
  5. link.set("class", css)
  6. link.set("articleName", wikiArticleName)
  7. wikiArticle = WikipediaArticle()
  8. wikiArticle.title = urllib.unquote(wikiArticleName)
  9. link.set("mediaitem", json.jsonSerialize(wikiArticle.jsProperties()))
Add Comment
Please, Sign In to add comment