fix xpaths for second category

This commit is contained in:
Norbert Litkowski 2021-04-07 12:20:34 +02:00
parent 1b7e1281f9
commit 4ad7fce898

View File

@ -28,9 +28,10 @@ extractNestedLinksWithText xpathCondition = proc url -> do
extractRecords = proc startUrl -> do
-- (catUrl, catText) <- extractLinksWithText "(//aside[@class='widget widget_maxmegamenu']//a[@class='mega-menu-link'])[1]" -< startUrl -- pary adres-tytuł podstrony
(catUrl, catText) <- extractLinksWithText "//aside[@class='widget widget_maxmegamenu']//a[@class='mega-menu-link']" -< startUrl -- pary adres-tytuł podstrony
(collUrl, collText) <- (extractLinksWithText "//aside[@class='widget widget_maxmegamenu']//a[@class='mega-menu-link']") -< catUrl -- pobieramy podstronę kategorii i kolejne podstrony z menu
(relUrl, relText) <- (extractNestedLinksWithText "//big[a[contains(@href,'.pdf')][img]]") -< collUrl -- pobieramy stronę z wydaniami z danej kolekcji i linki do PDFów
(relUrl, relText) <- (extractNestedLinksWithText "//big[a[contains(@href,'.pdf') and contains(text(), 'Pobierz PDF')]]") -< collUrl -- pobieramy stronę z wydaniami z danej kolekcji i linki do PDFów
returnA -< (((relUrl, relText), collText), catText) -- ostatecznie wyjdą krotki (((adres URL PDFa wydania, tytuł wydania), tytuł zbioru), tytuł kategorii)
-- ... a tutaj te krotki przerabiamy do docelowej struktury ShadowItem