Fix VG and Aftenposten scrapers for Schibsted redesign #12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "orbit-11-fix-schibsted-scrapers"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Both vg.no and aftenposten.no migrated to the same Schibsted frontend with build-hashed CSS-module class names, so the homepage scrapers' selectors matched nothing and both returned
no articles found.Change
scrapers/schibsted.gokeyed on stable hooks:a[data-content-type="article"]anchors for links and the teaser heading for titles.<br>turned into spaces — this reconstructs hero headlines split across styled spans (otherwiseDrittleidødtid) and avoids thePremium,kicker Schibsted folds into aria-labels.vg.goandaftenposten.gonow delegate to the shared parser.Article-page content extraction (
.article-body p/article p+ og: meta) was verified still working and is unchanged.Verification
go test ./scrapers/...passes; fixtures yield 19 (VG) and 14 (AP) articles.Note: four pre-existing failures in the
newspackage (db/server desk tests) are unrelated to this change and fail onmainas well.Closes #11