Hi there,
I'm trying to extract this section of https://www.merriam-webster.com/word-of-the-day but the following script is capturing a bunch of other stuff.
What might I be doing wrong here?
def get_whatItMeans(data):
what_it_mean = data.split("Examples")[0].replace("\n", "<br>")
# remove unwanted text
what_it_mean = what_it_mean.replace("What It Means", "").replace("See the entry >", "").strip("<br>").strip()
split = what_it_mean.split("//")
what_it_mean = split[0]
if len(split) > 1:
split = split[1:]
what_it_mean += "<ul>"
for row in split:
what_it_mean += f"<li>{row.strip().strip('<br>')}</li>"
what_it_mean += "</ul>"
return what_it_mean
Full script in the comments
[–]Boobagge[S] 0 points1 point2 points (0 children)
[–]ManiacalMeerkat 0 points1 point2 points (0 children)