Skip to content

Commit 270fa53

Browse files
authored
Merge pull request #14 from escalopa/dev
feat: update date to current
2 parents a7282bf + a4de356 commit 270fa53

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

_scripts/city/main.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const (
2121
)
2222

2323
var (
24-
years = []int{2024, 2025}
24+
years = []int{time.Now().Year()}
2525
)
2626

2727
type NodeIterator struct {
@@ -71,12 +71,13 @@ func main() {
7171
}
7272

7373
func parseHTML(url string) (*html.Node, error) {
74-
const XPATH = `/html/body/div[1]/div/div/div/div[2]/div/div/div/div[2]/div/div/table/tbody`
74+
const XPATH_1 = `/html/body/div[1]/div/div/div/div[2]/div/div/div/div[2]/div/div/table/tbody`
75+
const XPATH_2 = `/html/body/div/div/div/div/div[2]/div/div/div/div[4]/div/div/table/tbody`
7576

7677
doc, err := htmlquery.LoadURL(url)
7778
checkErr(err)
7879

79-
node, err := htmlquery.Query(doc, XPATH)
80+
node, err := htmlquery.Query(doc, XPATH_1)
8081
checkErr(err)
8182

8283
return node, nil

0 commit comments

Comments
 (0)