How to extract a number using scrapy?

Hello and thanks for taking the time to read this. I am quite new to scrapy and am trying to scrape just one number on a website. I tried using:

yield {
'myitem': response.css('span.theidofmyitem').extract_first()

but this seems only to work for text as using with this number (which is contained within span) a the value of none is returned. Thanks in advance for any help!