Skip to content

Instantly share code, notes, and snippets.

@acrymble
Created June 30, 2011 13:09
Show Gist options
  • Select an option

  • Save acrymble/1056197 to your computer and use it in GitHub Desktop.

Select an option

Save acrymble/1056197 to your computer and use it in GitHub Desktop.
obo.py
# obo.py
def stripTags(pageContents):
startLoc = pageContents.find("<hr/><h2>")
pageContents = pageContents[startLoc:]
inside = 0
text = ''
for char in pageContents:
if char == '<':
inside = 1
elif (inside == 1 and char == '>'):
inside = 0
elif inside == 1:
continue
else:
text += char
return text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment