jsmith613
March 11th, 2018, 03:51 PM
Hi
I have the following code in python:
start = '<description>'end = '</description>'
s = """
<description>This is the website description</description>
<description>This is the second description</description>
"""
print (s[s.find("<description>")+len("<description>"):s.find("</description>")])
How do I extract BOTH the first and second descriptions without the tags? thanks
btw I do not want to use the BeautifulSoup module.
I want to understand the code
I have the following code in python:
start = '<description>'end = '</description>'
s = """
<description>This is the website description</description>
<description>This is the second description</description>
"""
print (s[s.find("<description>")+len("<description>"):s.find("</description>")])
How do I extract BOTH the first and second descriptions without the tags? thanks
btw I do not want to use the BeautifulSoup module.
I want to understand the code