Skip to content
This repository has been archived by the owner on Aug 12, 2024. It is now read-only.

json.decoder.JSONDecodeError: in get_tweets() #201

Open
jmoraes7 opened this issue Mar 8, 2023 · 7 comments
Open

json.decoder.JSONDecodeError: in get_tweets() #201

jmoraes7 opened this issue Mar 8, 2023 · 7 comments

Comments

@jmoraes7
Copy link

jmoraes7 commented Mar 8, 2023

I'm trying to run the following code example from the documentation:

`Python 3.7.3 (default, Mar 26 2019, 21:43:19)
[GCC 8.2.1 20181127] on linux
Type "help", "copyright", "credits" or "license" for more information.

from twitter_scraper import get_tweets

for tweet in get_tweets('jdzie_', pages=1):
... print(tweet['text'])`

but end up hitting this error:

Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/username/miniconda3/lib/python3.9/site-packages/twitter_scraper/modules/tweets.py", line 170, in get_tweets yield from gen_tweets(pages) File "/Users/username/miniconda3/lib/python3.9/site-packages/twitter_scraper/modules/tweets.py", line 37, in gen_tweets html=r.json()["items_html"], url="bunk", default_encoding="utf-8" File "/Users/username/miniconda3/lib/python3.9/site-packages/requests/models.py", line 975, in json raise RequestsJSONDecodeError(e.msg, e.doc, e.pos) requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Anyone know why this is happening? Is this project still being maintained?

@sourface94
Copy link

I'm trying to run the following code example from the documentation:

`Python 3.7.3 (default, Mar 26 2019, 21:43:19) [GCC 8.2.1 20181127] on linux Type "help", "copyright", "credits" or "license" for more information.

from twitter_scraper import get_tweets
for tweet in get_tweets('jdzie_', pages=1):
... print(tweet['text'])`

but end up hitting this error:

Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/username/miniconda3/lib/python3.9/site-packages/twitter_scraper/modules/tweets.py", line 170, in get_tweets yield from gen_tweets(pages) File "/Users/username/miniconda3/lib/python3.9/site-packages/twitter_scraper/modules/tweets.py", line 37, in gen_tweets html=r.json()["items_html"], url="bunk", default_encoding="utf-8" File "/Users/username/miniconda3/lib/python3.9/site-packages/requests/models.py", line 975, in json raise RequestsJSONDecodeError(e.msg, e.doc, e.pos) requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Anyone know why this is happening? Is this project still being maintained?

Were you able to solve this?

@jmoraes7
Copy link
Author

jmoraes7 commented Apr 4, 2023

hey unfortunately not - ended up building our own scraper instead. still hoping someone figures out a solution though

what about you?

@sourface94
Copy link

hey unfortunately not - ended up building our own scraper instead. still hoping someone figures out a solution though

what about you?

No I havent, are you able to share your scraper?

@sweetbbak
Copy link

I have this issue still as well.

@devAyushDubey
Copy link

Did anyone find a work around?

@Mcrich23
Copy link

Mcrich23 commented Aug 4, 2023

@jmoraes7 link?

@CatBraaain
Copy link

same here

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

6 participants