This commit is contained in:
Tuomas Katajisto 2025-08-01 20:00:46 +03:00
parent ced49c3723
commit 5d35f38292
2 changed files with 3 additions and 1 deletions

View File

@ -217,6 +217,8 @@ func crawl_dua(db *sql.DB) {
fmt.Println("Visiting", r.URL) fmt.Println("Visiting", r.URL)
}) })
bookCollector.Visit(currenturl)
// On the book page, extract the details // On the book page, extract the details
bookCollector.OnHTML(`div.book-page`, func(e *colly.HTMLElement) { bookCollector.OnHTML(`div.book-page`, func(e *colly.HTMLElement) {
title := e.ChildText("h1") title := e.ChildText("h1")

View File

@ -11,7 +11,7 @@
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 25px; } .book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 25px; }
.book-card { background: #fff; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); overflow: hidden; text-align: center; transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; } .book-card { background: #fff; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); overflow: hidden; text-align: center; transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; }
.book-card:hover { transform: translateY(-5px); box-shadow: 0 8px 16px rgba(0,0,0,0.1); } .book-card:hover { transform: translateY(-5px); box-shadow: 0 8px 16px rgba(0,0,0,0.1); }
.book-card img { width: 100%; height: 300px; object-fit: cover; } .book-card img { width: 100%; height: 400px; object-fit: cover; }
.book-details { padding: 15px; } .book-details { padding: 15px; }
.book-details h2 { font-size: 1.2em; margin: 0 0 15px 0; min-height: 44px; } .book-details h2 { font-size: 1.2em; margin: 0 0 15px 0; min-height: 44px; }
.checkbox-group { display: flex; justify-content: space-around; align-items: center; } .checkbox-group { display: flex; justify-content: space-around; align-items: center; }