0

New to python. I scraped some tweets and store them in txt file. However, I can't open it with json.loads and it says

Expecting value: line 1 column 2 (char 1)

The beginning of the file is something like

['{"created_at": ...]

in the txt file.

Really need some help! Thanks!

Abdul Niyas P M
  • 18,035
  • 2
  • 25
  • 46
  • You are not writing JSON to the text file. Edit your question to describe how you stored the tweets and provide more sample that can be worked with. – Oluwafemi Sule Aug 26 '19 at 01:13
  • It seems like the data with the txt file is not a [valid JSON](https://stackoverflow.com/a/4162651/6699447). Use `ast.literal_eval` instead. – Abdul Niyas P M Aug 26 '19 at 01:15

0 Answers0