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

ValueError while Scrapping Posts #156

Open
InzamamAnwar opened this issue Feb 17, 2022 · 9 comments
Open

ValueError while Scrapping Posts #156

InzamamAnwar opened this issue Feb 17, 2022 · 9 comments

Comments

@InzamamAnwar
Copy link

Describe the bug
Scrapping post using Post method gives error.

Traceback (most recent call last):
  File "/instagram-scrapping/main.py", line 23, in <module>
    post.scrape(headers=headers)
  File "lib/python3.7/site-packages/instascrape/scrapers/post.py", line 88, in scrape
    return_instance.upload_date = datetime.datetime.fromtimestamp(return_instance.timestamp)
ValueError: Invalid value NaN (not a number)

To Reproduce
Steps to reproduce the behavior:

from instascrape import Post

headers = {'user-agent': '', 'cookie': 'sessionid:{SESSION_ID}'}

post = Post("https://www.instagram.com/p/CaDMviujr4q/")
post.scrape(headers=headers)

Expected behavior
Dictionary with Keys mentioned in Wiki-Scrapped Data points

Desktop (please complete the following information):

  • OS: [Ubuntu 18.04 LTS]
  • Browser [chrome]
  • Version [insta-scrape: 2.1.2, chrome: 98.0.4758.80, Python: 3.7.11]
@InzamamAnwar
Copy link
Author

@89z Thank You for your prompt reply, But I was looking solution(s) in Python.

@Lxand3r
Copy link

Lxand3r commented Feb 20, 2022

I have an alternate package that works:

package main
import "github.com/89z/mech/instagram"

func main() {
   login, err := instagram.NewLogin(username, password)
   if err != nil {
      panic(err)
   }
   items, err := login.Items("CaDMviujr4q")
   if err != nil {
      panic(err)
   }
   for _, item := range items {
      println(item.Caption.Text)
   }
}

where is this suppose to go ?

@Jay-flow
Copy link

I have the same problem.

@akouirouk
Copy link

I have the same problem as well

@UmeSiyah
Copy link

Me too, I have tired with the example script for joebien, get the same error.

@gentzeng
Copy link

Likewise

@Chocomagma
Copy link

I have the same problem as well

1 similar comment
@Chocomagma
Copy link

I have the same problem as well

@Suizer
Copy link

Suizer commented May 13, 2022

same issue

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

8 participants