Reason: list cannot be empty, and the content extracted by XPath may be empty, so I need to make a blank judgment
I use len
to judge, and then do other processing
Read More:
- IndexError: list index out of range [How to Solve]
- [Solved] yolo Error: IndexError: invalid index to scalar variable.
- The matching result of Python XPath is null
- [Solved] Python Selenium Error: AttributeError: ‘WebDriver‘ object has no attribute ‘find_element_by_xpath‘
- Python IndexError: too many indices for array: array is 1-dimensional, but 2 were i..
- [Solved] theano-GPU Error: pygpu.gpuarray.GpuArrayException: b‘cuMemAlloc: CUDA_ERROR_OUT_OF_MEMORY: out of memory
- The range of Chinese Unicode encoding and the calculation of the number of Chinese and English words in text
- When sending an email, an error was reported: AttributeError:’list’ object has no attribute’encode’
- Panda error in modifying line name index does not support mutable operations
- [Exception]’ascii’ codec can’t decode byte 0xe8 in position 2: ordinal not in range(128)
- How to Solve attributeerror: ‘list’ object has no attribute ‘shape‘
- [Solved] ValueError: row index was 65536, not allowed by .xls format
- Python errors: valueerror: if using all scalar values, you must pass an index (four solutions)
- [Solved] RuntimeError: scatter(): Expected dtype int64 for index
- [Solved] Selenium python send_key error: list object has no attribute
- [Solved] RuntimeError: gather(): Expected dtype int64 for index
- Python Valueerror: cannot index with vector containing Na / Nan values
- How to Solve Error: RuntimeError CUDA out of memory
- Django PythonConsole error: Requested setting DEFAULT_INDEX_TABLESPACE