twitterscraper
twitterscraper copied to clipboard
0 tweets
INFO: Retrying... (Attempts left: 1) INFO: Scraping tweets from https://twitter.com/search?f=tweets&vertical=default&q=bitcoin&l= INFO: Using proxy 181.211.38.62:47911 INFO: Got 0 tweets for bitcoin.
Parsing may be an issue. Both twitterscraper (0.9.3) and (1.4.0) are failing.
Have also been facing this issue. Queries that were returning tweets yesterday are not returning tweets today.
I'm also facing the Same issue! Yesterday it was parsing well, but today it returns 0 tweets
same here 0 tweets
same here 0 tweets
Seems Twitter has restricted the connection so that all requests return a page with "We've detected that JavaScript is disabled in your browser. Would you like to proceed to legacy Twitter?"
+1. That's bad.
INFO: Retrying... (Attempts left: 1) INFO: Scraping tweets from https://twitter.com/search?f=tweets&vertical=default&q=bitcoin&l= INFO: Using proxy 181.211.38.62:47911 INFO: Got 0 tweets for bitcoin.
Parsing may be an issue. Both twitterscraper (0.9.3) and (1.4.0) are failing.
hocam bende bir proje geliştirmiştim projemde ana kısım buna bağlı bu sorunu nasıl düzeltebiliriz
I need help
same here... anyone has a clue for whats going on?
Not yet. I used it for school university project. What will I do during the presentation
Seems Twitter has restricted the connection so that all requests return a page with "We've detected that JavaScript is disabled in your browser. Would you like to proceed to legacy Twitter?"
Indeed, this can be fixed by modifying the header dictionary in query.py from
HEADER = {'User-Agent': random.choice(HEADERS_LIST)}
to
HEADER = {'User-Agent': random.choice(HEADERS_LIST), 'X-Requested-With': 'XMLHttpRequest'}
that should fix the issue.
Seems Twitter has restricted the connection so that all requests return a page with "We've detected that JavaScript is disabled in your browser. Would you like to proceed to legacy Twitter?"
Indeed, this can be fixed by modifying the header dictionary in query.py from
HEADER = {'User-Agent': random.choice(HEADERS_LIST)}toHEADER = {'User-Agent': random.choice(HEADERS_LIST), 'X-Requested-With': 'XMLHttpRequest'}that should fix the issue.
It works for me! Thanks @rubengoeminne, genius!
Thanks
Seems Twitter has restricted the connection so that all requests return a page with "We've detected that JavaScript is disabled in your browser. Would you like to proceed to legacy Twitter?"
Indeed, this can be fixed by modifying the header dictionary in query.py from
HEADER = {'User-Agent': random.choice(HEADERS_LIST)}toHEADER = {'User-Agent': random.choice(HEADERS_LIST), 'X-Requested-With': 'XMLHttpRequest'}that should fix the issue.
I am very thank you. its work.
Seems Twitter has restricted the connection so that all requests return a page with "We've detected that JavaScript is disabled in your browser. Would you like to proceed to legacy Twitter?"
Indeed, this can be fixed by modifying the header dictionary in query.py from
HEADER = {'User-Agent': random.choice(HEADERS_LIST)}toHEADER = {'User-Agent': random.choice(HEADERS_LIST), 'X-Requested-With': 'XMLHttpRequest'}that should fix the issue.
its work.. thanks
hi guys, im a kind of noob and do not have a HEADER in my code... someone can tell how can i implement it?
Seems Twitter has restricted the connection so that all requests return a page with "We've detected that JavaScript is disabled in your browser. Would you like to proceed to legacy Twitter?"
Indeed, this can be fixed by modifying the header dictionary in query.py from
HEADER = {'User-Agent': random.choice(HEADERS_LIST)}toHEADER = {'User-Agent': random.choice(HEADERS_LIST), 'X-Requested-With': 'XMLHttpRequest'}that should fix the issue.
Thanks a lot my friend! This worked for me! You are a genius! Let me share you a beer @rubengoeminne! Paulaner German Beer? Or Negra Modelo Mexican Beer?
hi guys, im a kind of noob and do not have a HEADER in my code... someone can tell how can i implement it?
@toscanopedro The header dictionary: HEADER = {'User-Agent': random.choice(HEADERS_LIST)} is not in your own code, instead it is a line inside the file query.py
Just open the file as TXT, and change the lines, such as @rubengoeminne said. You could search the file in your PC, maybe it will be foun at the path: C:\ProgramData\Anaconda3\Lib\site-packages\twitterscraper
hi guys, im a kind of noob and do not have a HEADER in my code... someone can tell how can i implement it?
@toscanopedro The header dictionary: HEADER = {'User-Agent': random.choice(HEADERS_LIST)} is not in your own code, instead it is a line inside the file query.py
Just open the file as TXT, and change the lines, such as @rubengoeminne said. You could search the file in your PC, maybe it will be foun at the path: C:\ProgramData\Anaconda3\Lib\site-packages\twitterscraper
THX MAN!!!!
Seems Twitter has restricted the connection so that all requests return a page with "We've detected that JavaScript is disabled in your browser. Would you like to proceed to legacy Twitter?"
Indeed, this can be fixed by modifying the header dictionary in query.py from
HEADER = {'User-Agent': random.choice(HEADERS_LIST)}toHEADER = {'User-Agent': random.choice(HEADERS_LIST), 'X-Requested-With': 'XMLHttpRequest'}that should fix the issue.
The modification no longer works for query_user_info. I changed the header dictionary in query.py and still got no information on my list of users.
I faced the same issue. It seems to work now to retrieve the tweets. However I get this error when I want to have user info, using query_user_info : local variable 'user_info' referenced before assignment
Yah it is not working for me. Changed that line in query.py and same issue occurs.
Hi. I have implemented the modification suggested by pumpkinw and the algortihm made progress. It was not scraping anything before modification. But after modification it is scraping, but not everything. It seems it is scraping only some last hours. For example, when I issued:
twitterscraper fascismo --lang pt -p 1 -bd 2020-05-31 -ed 2020-06-01 -o file_name.json
I received tweets corresponding only to hours from 20 up to 23 of day 2020-05-31:
In [12]: df.groupby(df['timestamp'].dt.hour).count()
Out[12]:
has_media hashtags img_urls is_replied ... tweet_url user_id username video_url
timestamp ...
20 956 956 956 956 ... 956 956 956 956
21 2384 2384 2384 2384 ... 2384 2384 2384 2384
22 2100 2100 2100 2100 ... 2100 2100 2100 2100
23 2147 2147 2147 2147 ... 2147 2147 2147 2147
[4 rows x 21 columns]
Somebody know what is going on?
already changed the header from HEADER = {'User-Agent': random.choice(HEADERS_LIST)} to HEADER = {'User-Agent': random.choice(HEADERS_LIST), 'X-Requested-With': 'XMLHttpRequest'} but still have the same issue 'NoneType' object has no attribute 'user'.
I don't like modifying module's files directly, so instead of that and based on @rubengoeminne's great answer, to fix this issue you just have to add these line of codes to the top of your python script:
import twitterscraper
import random
HEADERS_LIST = [
'Mozilla/5.0 (Windows; U; Windows NT 6.1; x64; fr; rv:1.9.2.13) Gecko/20101203 Firebird/3.6.13',
'Mozilla/5.0 (compatible, MSIE 11, Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; rv:2.2) Gecko/20110201',
'Opera/9.80 (X11; Linux i686; Ubuntu/14.10) Presto/2.12.388 Version/12.16',
'Mozilla/5.0 (Windows NT 5.2; RW; rv:7.0a1) Gecko/20091211 SeaMonkey/9.23a1pre'
]
twitterscraper.query.HEADER = {'User-Agent': random.choice(HEADERS_LIST), 'X-Requested-With': 'XMLHttpRequest'}
And do your stuff normally:
from twitterscraper import query_tweets
query_tweets("github", 100)
Seems Twitter has restricted the connection so that all requests return a page with "We've detected that JavaScript is disabled in your browser. Would you like to proceed to legacy Twitter?"
Indeed, this can be fixed by modifying the header dictionary in query.py from
HEADER = {'User-Agent': random.choice(HEADERS_LIST)}toHEADER = {'User-Agent': random.choice(HEADERS_LIST), 'X-Requested-With': 'XMLHttpRequest'}that should fix the issue.
This solution seems not to work for me now.
Seems Twitter has restricted the connection so that all requests return a page with "We've detected that JavaScript is disabled in your browser. Would you like to proceed to legacy Twitter?"
Indeed, this can be fixed by modifying the header dictionary in query.py from
HEADER = {'User-Agent': random.choice(HEADERS_LIST)}toHEADER = {'User-Agent': random.choice(HEADERS_LIST), 'X-Requested-With': 'XMLHttpRequest'}that should fix the issue.This solution seems not to work for me now.
Yeah, unfortunately they close it down.
guys are you sure that you replace the correct arquive? this is still working for me
@toscanopedro where did you replace please ? I replaced in the query.py file, and it's not working... Thanks !
first you have to pip show twitterscraper to discover the locaticon of the twitterscraper directory. the mine was in: "c:\users\pedro\appdata\local\programs\python\python38-32\lib\site-packages" there is a folder called twitterscraper and the query.py arquive. And you have just to change it. the path may change, depends what idle you are using. but he is awais inside a "lib\site-packages"
@toscanopedro I am working on GCP, I changed the arquive manually as shown on the picture. Is is sufficient ?

Thanks