fix: set answer ID to data-answerid value (#135)

This commit is contained in:
httpjamesm 2024-06-16 14:05:02 -04:00 committed by GitHub
parent 80b45bf034
commit e278368ab7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -231,6 +231,8 @@ func extractAnswersData(doc *goquery.Document, domain string) ([]types.FilteredA
doc.Find("div.answer").Each(func(i int, s *goquery.Selection) {
var answer types.FilteredAnswer
answer.ID = s.AttrOr("data-answerid", "")
postLayout := s.Find("div.post-layout").First()
// Extract upvotes.