twitterscraper icon indicating copy to clipboard operation
twitterscraper copied to clipboard

AttributeError: 'NoneType' object has no attribute 'find_all'

Open wongpenghong opened this issue 5 years ago • 7 comments

when i run on version twitterscraper==1.4.0 , popup some error

wongpenghong avatar May 19 '20 09:05 wongpenghong

Please post your full traceback and command.

lapp0 avatar Jun 05 '20 18:06 lapp0

I have this issue too. traceback:

INFO: {'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 6.1; x64; fr; rv:1.9.2.13) Gecko/20101203 Firebird/3.6.13'}
Traceback (most recent call last):
  File "/share/python_scripts/twitterbotsearch.py", line 1, in <module>
    from twitterscraper import query_tweets
  File "/home/pi/.local/lib/python3.6/site-packages/twitterscraper/__init__.py", line 13, in <module>
    from twitterscraper.query import query_tweets
  File "/home/pi/.local/lib/python3.6/site-packages/twitterscraper/query.py", line 73, in <module>
    proxies = get_proxies()
  File "/home/pi/.local/lib/python3.6/site-packages/twitterscraper/query.py", line 46, in get_proxies
    list_tr = table.find_all('tr')
AttributeError: 'NoneType' object has no attribute 'find_all'

javad94 avatar Jun 06 '20 14:06 javad94

I have this issue too. traceback:

INFO: {'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 6.1; x64; fr; rv:1.9.2.13) Gecko/20101203 Firebird/3.6.13'}
Traceback (most recent call last):
  File "/share/python_scripts/twitterbotsearch.py", line 1, in <module>
    from twitterscraper import query_tweets
  File "/home/pi/.local/lib/python3.6/site-packages/twitterscraper/__init__.py", line 13, in <module>
    from twitterscraper.query import query_tweets
  File "/home/pi/.local/lib/python3.6/site-packages/twitterscraper/query.py", line 73, in <module>
    proxies = get_proxies()
  File "/home/pi/.local/lib/python3.6/site-packages/twitterscraper/query.py", line 46, in get_proxies
    list_tr = table.find_all('tr')
AttributeError: 'NoneType' object has no attribute 'find_all'

It is very likely to be caused by the empty list scraped from the proxy website.when the problem occurs, table should be empty. In this case, find_all method is not able to get anything from table. you could wait for a moment and retry it. It should be back to normal very soon.

zhicheng0501 avatar Jun 08 '20 13:06 zhicheng0501

What command are you running to get this traceback?

lapp0 avatar Jun 08 '20 16:06 lapp0

What command are you running to get this traceback?

torsocks twitterscraper Trump -l 1000

javad94 avatar Jun 08 '20 19:06 javad94

In query.py need change table = soup.find('table',id='proxylisttable') to table = soup.find('table', {"class": 'table'}) because they change proxy site

qreodium avatar Sep 03 '21 03:09 qreodium

Hi! I've changed the query.py as mentioned above, but I still don't succeed on solving the error. Any thoughts? My query was just running the example script:

examples/get_twitter_user_data.py

image

seaona avatar Sep 10 '21 09:09 seaona