IIRC, `findtext` will return empty string (`''`) by default if the matching item is not found. This means we will never get into this branch.

You can pass `no_text_value=''` to `findtext` function, or even better, just do `if not state`.