New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
object of type 'bool' has no len() error message #10
Comments
i realized that my json file structure wasn't EXACTLY the same as the examples, as my NFT doesn't have levels or stats, so i didn't add that to the json object... as a result i needed to modify the main.py code to reflect that in the 'create_parameters' function the str(parameters[x]) value needs to correspond with the data that you actually have in your json files... so if you don't have 'levels' or 'stats' in your json file, you're going to need to comment out the levels and stats part of the code, and then change the array value '[x]' to be in accordance with the actual layout of your json file... so after removing levels and stats, which would have been in places 6 and 7 in the parameters array, i needed to then array values following that, to account for those two not being there... i also did not use the 'method' class in my json file, so i commented that out as well.
you'll also need to change the line of code where parameter is defined, for example:
did this... and that seemed to fix it getting hung up at the create screen... now it actually adds the image, name, etc... adds the properties, but then when it gets to the part where it has to upload the stats and levels... its looking for parts in an array that no longer exist (because i took them out from paramaters array) so, i had to comment out the following lines as well:
which brought up another issue around line 419 (may be somewhere else in your code because i changed mine) basically the script checks the an array for a value in a certain place, and an error code is being thrown around line 419 because, again, object of type 'bool' has no len()... so to get around this i just hardcoded a variable called constUnlockableContent, set that to equal false, and in the part of the code where it would have checked the array, i just made it check to see if the value was true or not and if so, make the switch... after that though, i found it easier to just comment that part of the code out entirely... all the 'if' statements relating to the unlockable content and explicit/sensitive content... which GOT IT TO WORK... now it can create the NFT's but gets hung up on the part afterward where it lists it for sale... gotta figure that out next. |
I'm going to go ahead and mark this as closed, since the original issue has been figured out... i hope this info is helpful to someone else out there. it was pretty tough troubleshooting it on my own with very little documentation. |
i keep getting this error message, even though i have json files loaded in the data folder, when the selenium script runs, everything works great... metamask loads up, logs in, then opensea loads up and logs in with metamask... then it goes to the create NFT page and as soon as it tries to pull the data from the json and turn it into a list object and pass that data along to some function in the code, for whatever reason it seems to be interpreting the list to be boolean object rather than a list object, and it doesn't detect it having a length as a result. because of that, the properties in the json file don't seem to be detected (or they are just being passed through as true or false, idk). once it hits this spot in the process, (create NFT page) it basically hangs up on this and spits out this error message:
`main.py:189: DeprecationWarning: executable_path has been deprecated, please pass in a Service object
driver = webdriver.Chrome(self.webdriver_path, options=options)
Login to MetaMask extension. Logged to Metamask extension.
Login to Opensea. Logged to Opensea.
Traceback (most recent call last):
File "main.py", line 775, in
settings.get_nft(element) # Get data of the NFT.
File "main.py", line 100, in get_nft
self.json_file()
File "main.py", line 147, in json_file
self.create_parameters(_list)
File "main.py", line 66, in create_parameters
self.levels: list = self.type_parameters(
File "main.py", line 85, in type_parameters
if len(parameters) > 0:
TypeError: object of type 'bool' has no len()`
Not really sure what's causing this... i've looked at the code for a while and i can't seem to find why this is happening. My json files are formatted in the correct structure so it shouldn't be that...
I'm sure this is something simple that i'm just overlooking.
The text was updated successfully, but these errors were encountered: