Question: The html element is below,

```
<div style="width: 80.42%;" class="classA"></div>

```

Using this code I can extract the whole style element:

```
response.xpath("//div[@class='classA']").xpath("@style").extract()

```

But I want get the width value of the style element, that is 80.42%, how can I do?

Answer: 
you could use `cssutils`, first install with:

```
$ pip install cssutils

```

then use it in your code:

```
import cssutils
...

css_style = response.xpath("//div[@class='classA']/@style").extract()
parsed_css = cssutils.parseStyle(css_style)
print parsed_css.width # 80.42%

```
you could use .re(), like this:

```
response.xpath("//div[@class='classA']").xpath("@style").re('width: (\d+\.\d+%)')

```

it can be work