Last active
February 11, 2020 08:49
-
-
Save BMU-Verlag/4f3d5c3bf6251e9379530a22468d16c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def extract_data(response_content): | |
raw_html = BeautifulSoup(response_content, 'html.parser') | |
relevant_lines = get_relevant_lines(raw_html) | |
def get_relevant_lines(raw_html): | |
relevant_lines = [] | |
for index, element in enumerate(raw_html.select('li')): | |
current_line = element.text | |
if (re.match('.*\(\d{4}-\d{4}\).*', current_line)): | |
relevant_lines.append(current_line) | |
return relevant_lines |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment