Skip to content

Commit

Permalink
Fix Handelsblatt
Browse files Browse the repository at this point in the history
Closes #439
  • Loading branch information
stefanw committed May 9, 2024
1 parent adda977 commit f09d38e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const QUOTES = /["„].*["„]/

const extractQuery = (node: HTMLElement, quoted = true) => createQuery(node.innerText, quoted)
const createQuery = (text: string, quoted = true) => {
let query = text.split(' ').slice(2, 15).join(' ').replace('"', '')
let query = text.split(' ').slice(4, 17).join(' ').replace('"', '')
// remove some special chars
query = query.replace(/[!:?;'/()]/g, ' ').replace(/(((?<!\d)[,.])|([,.](?!\d)))/g, ' ').replace(/ {1,}/g, ' ')
// remove non-leading/trailing quotes
Expand Down Expand Up @@ -282,10 +282,10 @@ const sites: Sites = {
},
'www.handelsblatt.com': {
selectors: {
query: makeQueryFunc('.storyline-element app-storyline-paragraph app-rich-text p'),
query: makeQueryFunc('app-storyline-element app-storyline-paragraph app-rich-text p'),
date: 'app-story-date',
paywall: 'app-paywall',
main: '.storyline-element'
main: 'app-storyline-elements'
},
// start: (root) => {
// Array.from(root.querySelectorAll('.c-paywall')).forEach((el: HTMLElement) => {
Expand Down

0 comments on commit f09d38e

Please sign in to comment.