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
Post a Comment