This commit is contained in:
Peter Kleiweg
2026-06-10 13:31:55 +02:00
parent d7adc17d4b
commit a8bea0ab44
4 changed files with 10 additions and 10 deletions

View File

@@ -278,8 +278,8 @@ func doArticle(filename string, url string, title string, timestamp time.Time, n
specials, err := article.Search(`.//*[@data-content-type="GROUP"]`) specials, err := article.Search(`.//*[@data-content-type="GROUP"]`)
p(err) p(err)
for _, special := range specials { for i := len(specials) - 1; i >= 0; i-- {
special.Remove() specials[i].Remove()
} }
other, err := article.Search(`.//*[@data-content-type="PODCAST"]`) other, err := article.Search(`.//*[@data-content-type="PODCAST"]`)

View File

@@ -313,10 +313,10 @@ func doArticle(filename string, url string, title string, timestamp time.Time, n
_ = w(fmt.Errorf("no intro: %s", url)) _ = w(fmt.Errorf("no intro: %s", url))
} }
specials, err := article.Search(`.//section//aside | .//section//figure | .//section//b`) specials, err := article.Search(`.//aside | .//figure | .//figcaption | .//section//b`)
p(err) p(err)
for _, special := range specials { for i := len(specials) - 1; i >= 0; i-- {
special.Remove() specials[i].Remove()
} }
ell, err = article.Search(`.//section//*[@data-article-element-index]`) ell, err = article.Search(`.//section//*[@data-article-element-index]`)

View File

@@ -69,8 +69,8 @@ func main() {
root := doc.Root() root := doc.Root()
divs, err := root.Search(`//div[@class="donatieformlinks"]`) divs, err := root.Search(`//div[@class="donatieformlinks"]`)
x(err) x(err)
for _, div := range divs { for i := len(divs) - 1; i >= 0; i-- {
div.Remove() divs[i].Remove()
} }
pp, err := root.Search(`//body//p[not(.//a[contains(@href,"reportersonline.nl/support")])]`) pp, err := root.Search(`//body//p[not(.//a[contains(@href,"reportersonline.nl/support")])]`)
x(err) x(err)

View File

@@ -315,10 +315,10 @@ func doArticle(filename string, url string, title string, timestamp time.Time, n
_ = w(fmt.Errorf("no intro: %s", url)) _ = w(fmt.Errorf("no intro: %s", url))
} }
specials, err := article.Search(`.//section//aside | .//section//figure | .//section//b`) specials, err := article.Search(`.//aside | .//figure | .//figcaption | .//section//b`)
p(err) p(err)
for _, special := range specials { for i := len(specials) - 1; i >= 0; i-- {
special.Remove() specials[i].Remove()
} }
ell, err = article.Search(`.//section//*[@data-article-element-index]`) ell, err = article.Search(`.//section//*[@data-article-element-index]`)