updated to work with current amazon layout
This commit is contained in:
parent
7c1cd3288d
commit
09e4d0313b
11
ambrowse.go
11
ambrowse.go
|
@ -95,17 +95,15 @@ func getAuthors(doc *goutil.HtmlNode) []string {
|
|||
}
|
||||
|
||||
func setDetails(b *book, doc *goutil.HtmlNode) {
|
||||
details := doc.GetElementById("detail-bullets")
|
||||
details := doc.GetElementById("productDetailsTable")
|
||||
if details == nil {
|
||||
details = doc.GetElementById("detail_bullets_id")
|
||||
details = doc.GetElementById("detailBullets_feature_div")
|
||||
}
|
||||
if details != nil {
|
||||
tmpcont := details.GetElementsByClass("content")
|
||||
if len(tmpcont) > 0 {
|
||||
cont := tmpcont[0].FindAll(func(n *goutil.HtmlNode) bool { return n.Type == html.ElementNode && n.Data == "li" })
|
||||
cont := details.FindAll(func(n *goutil.HtmlNode) bool { return n.Type == html.ElementNode && n.Data == "li" })
|
||||
for _, c := range cont {
|
||||
line := c.Text()
|
||||
if strings.Contains(line, "Verlag") || strings.Contains(line, "Publisher") {
|
||||
if strings.Contains(line, "Verlag") || strings.Contains(line, "Publisher") || strings.Contains(line, "Herausgeber") {
|
||||
b.publisher = readLine(line)
|
||||
} else if strings.Contains(line, "ISBN-10") {
|
||||
b.isbn10 = readLine(line)
|
||||
|
@ -115,7 +113,6 @@ func setDetails(b *book, doc *goutil.HtmlNode) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func getPrice(doc *goutil.HtmlNode) string {
|
||||
price := doc.GetElementsByClass("a-color-price")
|
||||
|
|
Loading…
Reference in New Issue
Block a user