chris-greening / instascrape

Powerful and flexible Instagram scraping library for Python, providing easy-to-use and expressive tools for accessing data programmatically
https://chris-greening.github.io/instascrape/
MIT License
625 stars 109 forks source link

ValueError while Scrapping Posts #156

Open InzamamAnwar opened 2 years ago

InzamamAnwar commented 2 years ago

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):

InzamamAnwar commented 2 years ago

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

Lxand3r commented 2 years ago

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 commented 2 years ago

I have the same problem.

akouirouk commented 2 years ago

I have the same problem as well

UmeSiyah commented 2 years ago

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

gentzeng commented 2 years ago

Likewise

Chocomagma commented 2 years ago

I have the same problem as well

Chocomagma commented 2 years ago

I have the same problem as well

Suizer commented 2 years ago

same issue