If you’re into one-liners, you could do:
```python
has_class = 'class' in element.get_attribute('outerHTML')
```
But... it’s hacky and might break if the HTML formatting changes.
For webelement has attribute python, I’d still recommend `get_attribute() + None` check. Boring but reliable.
```python
has_class = 'class' in element.get_attribute('outerHTML')
```
But... it’s hacky and might break if the HTML formatting changes.
For webelement has attribute python, I’d still recommend `get_attribute() + None` check. Boring but reliable.
