Skip to content
Snippets Groups Projects
Commit a45c02eb authored by Lucas Schons's avatar Lucas Schons
Browse files

Merge branch 'fix-get_birthdate' into 'master'

Fix get_birthdate

See merge request !33
parents 9945b3bb fde1d815
No related branches found
No related tags found
1 merge request!33Fix get_birthdate
...@@ -63,7 +63,7 @@ getIntroduction <- function(article) { ...@@ -63,7 +63,7 @@ getIntroduction <- function(article) {
xml2::xml_add_sibling("p", "\n") xml2::xml_add_sibling("p", "\n")
xml2::xml_find_all(page, ".//br") %>% xml2::xml_find_all(page, ".//br") %>%
xml2::xml_remove xml2::xml_remove(.)
# Get all paragraphs # Get all paragraphs
paragraphs <- page %>% paragraphs <- page %>%
...@@ -73,7 +73,7 @@ getIntroduction <- function(article) { ...@@ -73,7 +73,7 @@ getIntroduction <- function(article) {
# There will be some leading paragraphs containing only "\n" # There will be some leading paragraphs containing only "\n"
# Remove those leading paragraphs # Remove those leading paragraphs
remove <- c("\n") remove <- c("\n")
cleaned <- data.table::setdiff(paragraphs, remove) cleaned <- setdiff(paragraphs, remove)
introduction <- cleaned[1] introduction <- cleaned[1]
# Return first paragraph # Return first paragraph
......
...@@ -27,7 +27,7 @@ get_infobox <- function(article) { ...@@ -27,7 +27,7 @@ get_infobox <- function(article) {
xml2::xml_add_sibling("p", "\n") xml2::xml_add_sibling("p", "\n")
xml2::xml_find_all(page, ".//br") %>% xml2::xml_find_all(page, ".//br") %>%
xml2::xml_remove() xml2::xml_remove(.)
# Get the info box # Get the info box
# Will throw an error if there isnt any, so that should be checked beforehand # Will throw an error if there isnt any, so that should be checked beforehand
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment