js finder

sagyakwa Oct 21st, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from bs4 import BeautifulSoup
  3. parsed = BeautifulSoup('<div><span jsname="566516">Blah Blahs</span></div>', 'lxml')
  4. for element in parsed.find_all("div"):
  5.     for span in element.find_all("span"):
  6.         try:
  7.             span['jsname']
  8.             print(span)
  9.         except KeyError:
  10.             print("no Span")
  11.             pass
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand