Instapy: AttributeError: 'list' object has no attribute 'lower'

Created on 6 Aug 2019  Â·  14Comments  Â·  Source: timgrossmann/InstaPy

I get this error:
Anyone know what's wrong?

"AttributeError: 'list' object has no attribute 'lower'"

Traceback (most recent call last):
File "/home/x/InstaPy/bellman2.py", line 119, in
session.interact_user_followers(random_targets, amount=random.randint(10, 20), randomize=True)
File "/home/x/InstaPy/instapy/instapy.py", line 2940, in interact_user_followers
validation, details = self.validate_user_call(person)
File "/home/x/InstaPy/instapy/instapy.py", line 1248, in validate_user_call
self.logfolder)
File "/home/x/InstaPy/instapy/util.py", line 382, in validate_username
if bio_keyword.lower() in profile_bio.lower():
AttributeError: 'list' object has no attribute 'lower'

Most helpful comment

@uluQulu thx for the help :) Cheers!

All 14 comments

@uluQulu

Hey @fgisslen

It is a bug in util.py:

image

  1. Add a new line:
profile_bio = getUserData("graphql.user.biography", browser)
profile_bio = [pb.lower() for pb in profile_bio]   # ADD THIS NEW LINE
  1. Change this line:
if bio_keyword.lower() in profile_bio.lower():

becomes

if bio_keyword.lower() in profile_bio:

Chill 😎

@uluQulu thx m8

@uluQulu actually I still get after editing:

Traceback (most recent call last):
File "x.py", line 119, in
session.interact_user_followers(random_targets, amount=random.randint(10, 20), randomize=True)
File "/home/x/InstaPy/instapy/instapy.py", line 2940, in interact_user_followers
validation, details = self.validate_user_call(person)
File "/home/x/InstaPy/instapy/instapy.py", line 1248, in validate_user_call
self.logfolder)
File "/home/x/InstaPy/instapy/util.py", line 383, in validate_username
if bio_keyword.lower() in profile_bio:
AttributeError: 'list' object has no attribute 'lower'

Thanks all for revising this, tested after editing. Exiting script / session with the following traceback log

Traceback (most recent call last):
File "C:\Users\Engineering\AppData\Local\Programs\Python\Python36\Lib\site-packages\Follow Unfollow Schedule Like Feed Adapted Following CommentersV2.py", line 195, in follow
interact=True)
File "C:\Users\Engineering\AppData\Local\Programs\Python\Python36\Lib\site-packages\instapy\instapy.py", line 3273, in follow_user_followers
validation, details = self.validate_user_call(person)
File "C:\Users\Engineering\AppData\Local\Programs\Python\Python36\Lib\site-packages\instapy\instapy.py", line 1248, in validate_user_call
self.logfolder)
File "C:\Users\Engineering\AppData\Local\Programs\Python\Python36\Lib\site-packages\instapy\util.py", line 383, in validate_username
if bio_keyword.lower() in profile_bio:
AttributeError: 'list' object has no attribute 'lower'

@fgisslen
Revert back previous changes, I just checked, graphql returns a string rather than list.
So, the problem is in user entry,
How do you provide skip_bio_keyword value in quickstart script?
Make sure it has only 1 level of list; In other words, it is a list having strings only.

@uluQulu I don't use skip_bio_keyword

Can you tell which exact version of InstaPy you are using or attach util.py and instapy.py files.
Also attach your qucikstart script (personal data removed).

ok ok no need to it,
it is a mechanical bug;

@uluQulu perfect!
How do we solve it? :)

image
It is passed instead of the dont_skip_business_categories place which is prob a list of list that makes the issue.

So, move down the formal argument into its correct order.
image

Have fun ☕

@uluQulu thx for the help :) Cheers!

@uluQulu thx for the help :) Cheers!

Thanks for your help @uluQulu ! Made the mods and already working on one session. Will keep testing acrross today in case I see something else. Cheers!

thank you so much, @uluQulu ! working awesome now!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  Â·  3Comments

seuraltimez picture seuraltimez  Â·  3Comments

n0sw34r picture n0sw34r  Â·  3Comments

wyvers picture wyvers  Â·  3Comments

CodeMaster1 picture CodeMaster1  Â·  3Comments