html - Having trouble finding Span tag (Python 3) -


i'm trying strip out span tags html file.

i using page has lot of span tags in it. need extract numbers , add them together. however, can't lines need out, hoping can offer advice.

my code below:

from urllib.request import urlopen bs4 import beautifulsoup import ssl  # ignore ssl certificate errors ctx = ssl.create_default_context() ctx.check_hostname = false ctx.verify_mode = ssl.cert_none  # url = input('enter - ') html = urlopen(url, context=ctx).read()  soup = beautifulsoup(html, "html.parser") # print(soup)  spans = soup.findall('span') span in spans:     print span 

thanks


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -