We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 42791cb commit 44d5a20Copy full SHA for 44d5a20
cmd/root.go
@@ -161,7 +161,12 @@ func ParseRepos(r io.Reader) ([]Repository, error) {
161
for _, article := range articleList {
162
repo = &Repository{}
163
// Href, RepoName
164
- hrefPath := htmlquery.SelectAttr(htmlquery.FindOne(article, "/h1/a"), "href")
+ repoLinkNode := htmlquery.FindOne(article, "/h2/a")
165
+ if repoLinkNode == nil {
166
+ return nil, fmt.Errorf("repository link cannot be found")
167
+ }
168
+
169
+ hrefPath := htmlquery.SelectAttr(repoLinkNode, "href")
170
repo.Href = path.Join(githubURL, hrefPath)
171
repoName := strings.Split(hrefPath, "/")
172
repo.RepoName = repoName[1] + "/" + repoName[2]
0 commit comments