Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

panic: response status 404 Not Found: {"errors":[{"message":"Sorry, that page does not exist","code":34}]} #140

Open
talesricr opened this issue Sep 21, 2023 · 0 comments

Comments

@talesricr
Copy link

I'm getting this error when try to run my code:

panic: response status 404 Not Found: {"errors":[{"message":"Sorry, that page does not exist","code":34}]}

goroutine 1 [running]:
main.main()
/root/ws/go/teste.go:19 +0x4b8
exit status 2

It was working but stoped at some point. Here is my code:

package main

import (
 "context"
 "fmt"
 "time"

 twitterscraper "github.com/n0madic/twitter-scraper"
)

func main() {
 scraper := twitterscraper.New().WithDelay(4)
 scraper.WithClientTimeout(time.Second * 20)
 scraper.SetSearchMode(twitterscraper.SearchLatest)
 scraper.Login("Username", "Password")

 for tweet := range scraper.SearchTweets(context.Background(), "Twitter", 5) {
  if tweet.Error != nil {
   panic(tweet.Error)
  }
  fmt.Println(tweet.Username)
  fmt.Println(tweet.Text)
  fmt.Println(tweet.Likes)
  fmt.Println(tweet.Replies)
  fmt.Println("----------------")
 }
}

I tried to change the SearchTweets method to to GetTweets but go this error:

panic: response status 429 Too Many Requests:

goroutine 1 [running]:
main.main()
/root/ws/go/teste.go:19 +0x4b8
exit status 2

Don't know if I'm doing something wrong, or Twitter has broken this Search Mode, because it was working until 2 or 3 months ago.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant