Edit: Here is the code I am trying to use:
from bs4 import BeautifulSoup
import re
import sys
m = re.compile("^\d\d:\d\d$")
readfile = open("C:\\Temp\\LearnPythonTheCompletePythonProgrammingCourse_Udemy.htm", 'r').read()
soup = BeautifulSoup(readfile, "html.parser")
ci_details = soup.findAll("span",{"class":"ci-details"})
timeList = []
for detail in ci_details:
for span in detail.findAll("span"):
if m.match(span.text):
timeList.append(span.text)
print (timeList)
for i in timeList:
time1=timeList[0]
print(time1)
edit I realized looking this over that I am telling Python to print time1 for every item in timeList. How do I iterate over timeList ?
I want to use dstubeda's code to take each entry in the list, convert it to raw seconds, add them up. Then once done, I will convert them to h:m:s. Where did I go wrong with my for loop?