I am trying to retrieve the contents of a list that contains of tag elements.
The lists consists for example of the following :
list_titles = [tag, tag, tag]
Where each tag is described by the following structure:
list_titles[i] = <meta content="first title" name="title"/>
And I need to retrieve the titles of these tags. Therefore, I tried to the following:
content_list = []
for title in list_title:
content = title['content']
content_list.append(content)
And also tried the following:
for i, title in enumerate(list_title):
test = list_title[i]
content = test['content']
Both give the error 'NoneType' object is not subscriptable'. What is the correct way to get the content of each bs4 tag?