How are you running the script? Do you include arguments in the run command? e.g. python script.py https://google.com
? If you do not specify any arg, the list will be empty.
There is also the possibility for you only having one element inside the list, while Python starts indexes from 0
.
This means, the first element of the argv
list would be accessed through:
argv[0]