Skip to content

Instantly share code, notes, and snippets.

@DanNi0130
Created February 24, 2019 06:59
Show Gist options
  • Save DanNi0130/a6357b325deb3ccc3a8475a79cfdc743 to your computer and use it in GitHub Desktop.
Save DanNi0130/a6357b325deb3ccc3a8475a79cfdc743 to your computer and use it in GitHub Desktop.
IDsearch = re.compile(r'id=(\d+)') # This searches for anything that starts with ‘id=’ and ends with a string of numbers, capturing the string of numbers
threadIDs = IDsearch.findall(str(cleanpagedata)) # We need to convert the BeautifulSoup output to a string in order to search with regex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment