Repository navigation
Description
journal does two jobs in Scraper: it is the storage folder (html/<journal>/<pmid>.html) and the key for journal-specific behaviour in check_for_substitute_url and get_html. ns-pond-ingestion-workflow calls process_article(pmid, "IngestionWorkflow", ...), so no journal-name rule ever fires there. ACE's own retrieve_articles(journal=None) passes efetch's Journal/Title, which often doesn't match the hard-coded names either ("The European journal of neuroscience", "The Journal of neuroscience : the official journal of the Society for Neuroscience").
What we measured
These numbers are from ns-pond's catalog: 18,770 pages scraped under IngestionWorkflow, plus 2,025 stored under real journal names.
- Wiley abstract→full (L686) and the
relatedArticleswait (L433) do nothing on current URLs. LinkOut givesdoi.org/<doi>, which lands ononlinelibrary.wiley.com/doi/<doi>, and that page is already full text: HBM 56/57, EJN 29/30, and 95/100 of other sampled Wiley journals. - JoCN
doi/abs→doi/full(L690): currentdirect.mit.eduURLs contain nodoi/abs. - Frontiers (L692):
'xml\/nlm'is not a raw string, so the rewrite produces a literal backslash, and that URL returns 404..../xml/nlmitself still returns 200 text/xml. - PLoS (L678): keyed on a 7-name map that misses newer titles. In browser mode the manuscript URL is served as an attachment, so Chrome downloads it and ACE saves an empty page (found while reviewing Never open PubMed web pages; open no-LinkOut PLoS articles at doi.org from the keyed esummary DOI (ace-no-pubmed-page) #69).
- J Neurosci table clicks (L462): apart from the name key,
htmlis read at L449, before the clicks, and that copy is what L498 returns. Clicked tables never reach the result. The ScienceDirect and Wiley waits at L476-L488 have the same problem: they wait, but the HTML was already read. HighWire'sT<n>.expansion.htmlfallback at extract time gets a Cloudflare 403.- ACE extracts of 2,991 J Neurosci pages found tables in 26.
- 2,818 J Neurosci articles have ACE as their only text and no table from any source.
- In a sample of 1,500 current pages, 3.6% have uncaptured
.table-expand-inlinetables (AJNR, J Nucl Med, BMJ Case Rep, J Neurosci). A name rule would never cover most of those.
Text lost because the rules don't fire: about none. Only 182 of the 18,770 pages are from the affected journals, and 161 of them are full text anyway. PMC already covers PLOS and almost all of Frontiers. The real loss is tables, and fixing the journal name alone wouldn't recover them, because of the read-before-click bug above.
Proposed change
- Remove
journalfromcheck_for_substitute_url,get_htmlandget_html_by_pmid, and keep it only as the storage folder. Key every rule on the page's own final URL or content. - Delete the Wiley and JoCN rewrites and the Wiley
relatedArticleswait (no-ops on current sites). - Key PLoS on the
journals.plos.orgURL, taking the site slug and DOI from the URL path, and dropPLOS_JOURNAL_SITES. If the XML is still wanted in browser mode, it can't come from an attachment download. - Key Frontiers on the
frontiersin.orgURL, with replacementr'/xml/nlm'. - Click
.table-expand-inlinewhenever the page has it, whatever the journal, and readpage_sourceafter the clicks and waits. - Tests: VCR cassettes of one current page per rule (Frontiers XML, a HighWire page with a collapsed table), each asserting the saved HTML contains the table.
Also in these lines: L422 starts a second Driver without quitting the first (one leaked Chrome per Springer/ScienceDirect rewrite, plausibly), and the retry loop at L458 reloads url, not new_url.
Downstream (ns-pond), the J Neurosci and other collapsed-table pages need their ACE downloads refreshed after this change for the tables to show up. No change is needed in ns-pond itself: passing a real journal name would move the cache folder, comes in several spellings per journal, and would switch on the PLoS rewrite.
Opened by Claude Code on the user's behalf.
Activity