Removed unnecessary if statements
This commit is contained in:
parent
4ecb6e3a29
commit
c02435ccaa
1 changed files with 0 additions and 6 deletions
|
|
@ -36,17 +36,11 @@ func getPricesScg(name string) ([]scgCardPrice, error) {
|
||||||
linkNode := htmlquery.FindOne(block, "//h2/a")
|
linkNode := htmlquery.FindOne(block, "//h2/a")
|
||||||
price.link = scgDomain + htmlquery.SelectAttr(linkNode, "href")
|
price.link = scgDomain + htmlquery.SelectAttr(linkNode, "href")
|
||||||
editionNode := htmlquery.FindOne(block, "//p[@class=\"hawk-results-item__category\"]/a")
|
editionNode := htmlquery.FindOne(block, "//p[@class=\"hawk-results-item__category\"]/a")
|
||||||
if editionNode.FirstChild == nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if !strings.HasPrefix(htmlquery.SelectAttr(editionNode, "href"), "/shop/singles/") {
|
if !strings.HasPrefix(htmlquery.SelectAttr(editionNode, "href"), "/shop/singles/") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
price.edition = editionNode.FirstChild.Data
|
price.edition = editionNode.FirstChild.Data
|
||||||
priceNode := htmlquery.FindOne(block, "//span[@class='hawk-old-price']|//div[contains(concat(' ',normalize-space(@class),' '),' hawk-results-item__options-table-cell--price ')]")
|
priceNode := htmlquery.FindOne(block, "//span[@class='hawk-old-price']|//div[contains(concat(' ',normalize-space(@class),' '),' hawk-results-item__options-table-cell--price ')]")
|
||||||
if priceNode.FirstChild == nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
price.price = priceNode.FirstChild.Data
|
price.price = priceNode.FirstChild.Data
|
||||||
results = append(results, price)
|
results = append(results, price)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue