Inline table without a public URL
+Activation peaks are listed in Table 1.
+| Region | x | y | z | Peak Z |
|---|---|---|---|---|
| Left amygdala | -22 | -6 | -16 | 4.1 |
| Right insula | 36 | 18 | 2 | 3.8 |
diff --git a/ace/sources.py b/ace/sources.py index f5a04f4..2102564 100644 --- a/ace/sources.py +++ b/ace/sources.py @@ -1413,9 +1413,18 @@ def parse_article(self, html, pmid=None, **kwargs): if not soup: return False + # Current pages carry no public URL and print their tables inline. + public_url = soup.find('meta', {'name': 'citation_public_url'}) + if public_url is None: + tables = [] + self._append_leaf_candidate_tables(soup, tables) + self.article.tables = tables + if not tables: + self.article.missing_source = True + return self.article + # To download tables, we need the content URL and the number of tables - content_url = soup.find('meta', { - 'name': 'citation_public_url'})['content'] + content_url = public_url['content'] n_tables = len(soup.find_all('span', class_='table-label')) diff --git a/ace/tests/data/highwire_inline_table.html b/ace/tests/data/highwire_inline_table.html new file mode 100644 index 0000000..35a1fe3 --- /dev/null +++ b/ace/tests/data/highwire_inline_table.html @@ -0,0 +1,26 @@ + + +
+ + + +Activation peaks are listed in Table 1.
+| Region | x | y | z | Peak Z |
|---|---|---|---|---|
| Left amygdala | -22 | -6 | -16 | 4.1 |
| Right insula | 36 | 18 | 2 | 3.8 |