maximedrn / opensea-automatic-bulk-upload-and-sale

A Selenium Python bot to automatically and bulk upload/ mint and list your NFTs on OpenSea. All metadata compatible, Ethereum and Polygon blockchains supported, reCAPTCHA solvers included.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

List index out of range

emielmaters opened this issue · comments

Hello,
It appears that the uploading does not work properly. Some time ago, the test worked.
Now I want to upload the NFT's, but I get the following error:

Traceback (most recent call last): File "D:\Users\Emiel Maters\Downloads\opensea-automatic-bulk-upload-and-sale-master(1)\opensea-automatic-bulk-upload-and-sale-master\main.py", line 716, in <module> structure.get_data(nft_number) # Structure the data of the NFT. File "D:\Users\Emiel Maters\Downloads\opensea-automatic-bulk-upload-and-sale-master(1)\opensea-automatic-bulk-upload-and-sale-master\main.py", line 103, in get_data eval('self.structure_' + self.extension + '()') File "<string>", line 1, in <module> File "D:\Users\Emiel Maters\Downloads\opensea-automatic-bulk-upload-and-sale-master(1)\opensea-automatic-bulk-upload-and-sale-master\main.py", line 122, in structure_xlsx self.structure_data([ File "D:\Users\Emiel Maters\Downloads\opensea-automatic-bulk-upload-and-sale-master(1)\opensea-automatic-bulk-upload-and-sale-master\main.py", line 170, in structure_data self.unlockable_content: list or bool = nft_data[8] # [bool, str]. IndexError: list index out of range PS D:\Users\Emiel Maters\Downloads\opensea-automatic-bulk-upload-and-sale-master(1)\opensea-automatic-bulk-upload-and-sale-master>

I can't find what occurs the error. The excel file seems fine, I used [False] as argument.

Kind regards,
Emiel

I would like to suggest that you try and format the error message better. i.e. use:

```
...
error message
...
```

PS: I'd love to help, If this issue is still open I would like to take it up
Cheers! 🎊

Thanks for your response.

So, this is the whole error message, I think:

...
Traceback (most recent call last): File "D:\Users\Emiel Maters\Downloads\opensea-automatic-bulk-upload-and-sale-master(1)\opensea-automatic-bulk-upload-and-sale-master\main.py", line 716, in <module> structure.get_data(nft_number) # Structure the data of the NFT. File "D:\Users\Emiel Maters\Downloads\opensea-automatic-bulk-upload-and-sale-master(1)\opensea-automatic-bulk-upload-and-sale-master\main.py", line 103, in get_data eval('self.structure_' + self.extension + '()') File "<string>", line 1, in <module> File "D:\Users\Emiel Maters\Downloads\opensea-automatic-bulk-upload-and-sale-master(1)\opensea-automatic-bulk-upload-and-sale-master\main.py", line 122, in structure_xlsx self.structure_data([ File "D:\Users\Emiel Maters\Downloads\opensea-automatic-bulk-upload-and-sale-master(1)\opensea-automatic-bulk-upload-and-sale-master\main.py", line 170, in structure_data self.unlockable_content: list or bool = nft_data[8] # [bool, str]. IndexError: list index out of range PS D:\Users\Emiel Maters\Downloads\opensea-automatic-bulk-upload-and-sale-master(1)\opensea-automatic-bulk-upload-and-sale-master>
...

I think it gives an error on the data from the Excel file, but I checked it twice. The input is a boolean: [False].

I believe the error shows the problem is with line 170 in main.py:

self.unlockable_content: list or bool = nft_data[8] # [bool, str].

Could you please tell me what nft_data is about, is there a defined structure for the array?

The code's a bit messy, to be honest.

Also, there is no checking for the length of nft_data or about it's structure, so it's inevitable that the index error will come if the array is, say, empty.

Also, the get_data function is bad practice, better to use checking of strings and extensions rather than evaling. eval is unsafe.

It's best to implement checking of the data extracted from the structure_<extension> methods

Send me an excerpt of your file

I believe the error shows the problem is with line 170 in main.py:

self.unlockable_content: list or bool = nft_data[8] # [bool, str].

Could you please tell me what nft_data is about, is there a defined structure for the array?

The code's a bit messy, to be honest.

Also, there is no checking for the length of nft_data or about it's structure, so it's inevitable that the index error will come if the array is, say, empty.

Also, the get_data function is bad practice, better to use checking of strings and extensions rather than evaling. eval is unsafe.

It's best to implement checking of the data extracted from the structure_<extension> methods

eval method is not bad when using correctly

Do you want me to send the complete .xlsx file?
Or is this enough:
afbeelding

Kind regards,
Emiel

Do you want me to send the complete .xlsx file?

If you can, please do send the format for the .xlsx file. Don't send the entire file though.

Oke, see the file below:
Map1.xlsx
Is this working for you?

You file path is incorrect, change the "" with "\" or "/".
Duration cannot be "6 months", you have to use the DD-MM-YYYY hh:mm format.

I believe the error shows the problem is with line 170 in main.py:

self.unlockable_content: list or bool = nft_data[8] # [bool, str].

Could you please tell me what nft_data is about, is there a defined structure for the array?

The code's a bit messy, to be honest.

Also, there is no checking for the length of nft_data or about it's structure, so it's inevitable that the index error will come if the array is, say, empty.

Also, the get_data function is bad practice, better to use checking of strings and extensions rather than evaling. eval is unsafe.

It's best to implement checking of the data extracted from the structure_<extension> methods

I will add in a next update some changes concerning the Structure class, many people get errors because they do not follow the README file :/

I will add in a next update some changes concerning the Structure class, many people get errors because they do not follow the README file :/

True, but it's best to assume the worst from the end-user, isn't it?. Clean and organized code is good code 😄
I do want to know exactly how the nft_data is obtained. Is it through some sort of API or is it parsed in some way?

Knowing this may save us the effort of implementing a useless class if the data is always in the same format. If this is the case, it's best to just implement the checking.

When I want to start the script, it now gives another error:

...
 line 32, in <module>
    from webdriver_manager.chrome import ChromeDriverManager as CDM
ModuleNotFoundError: No module named 'webdriver_manager'
...

I have the most up-to-date chrome driver.

Visual code gives this message: Import "webdriver_manager.chrome" could not be resolved.

Does someone know what is going wrong?

pip install -r requirements.txt
I added a new module that automatically download the webdriver.