title: Scrapy: removing html from an array returned to items.py dictionary
body: <p>Firstly, thanks for any and all help!</p>
  <p>...new to stackoverflow (&amp; python) si I apologize for using the wrong terminology :)</p>
  <p>I'm using Scrapy to pull data from an html source, which creates dict fields in it's items.py by using Scrapy's selectors:</p>
  <pre><code>def parse_item(self, response):
  
      item = SiennaautoItem() #instatiating dict
      item['attributes'] = response.css('p.attrgroup').extract()
  
      yield item
  </code></pre>
  <p>this returns a dict that has an array/list with multiple value:</p>
  <pre><code>&gt; ['&lt;p class=&quot;attrgroup&quot;&gt;\n\n\n\n            &lt;span&gt;&lt;b&gt;2014 honda odyssey
  &gt; touring elite&lt;/b&gt;&lt;/span&gt;\n            &lt;br&gt;\n\n    &lt;/p&gt;', '&lt;p
  &gt; class=&quot;attrgroup&quot;&gt;\n\n\n\n            &lt;span&gt;VIN:
  &gt; &lt;b&gt;5FNRL5H66EB107700&lt;/b&gt;&lt;/span&gt;\n            &lt;br&gt;\n\n\n\n\n           
  &gt; &lt;span&gt;condition: &lt;b&gt;like new&lt;/b&gt;&lt;/span&gt;\n            &lt;br&gt;\n\n\n\n\n   
  &gt; &lt;span&gt;cylinders: &lt;b&gt;6 cylinders&lt;/b&gt;&lt;/span&gt;\n            &lt;br&gt;\n\n\n\n\n
  &gt; &lt;span&gt;drive: &lt;b&gt;fwd&lt;/b&gt;&lt;/span&gt;\n            &lt;br&gt;\n\n\n\n\n           
  &gt; &lt;span&gt;fuel: &lt;b&gt;gas&lt;/b&gt;&lt;/span&gt;\n            &lt;br&gt;\n\n\n\n\n           
  &gt; &lt;span&gt;odometer: &lt;b&gt;99000&lt;/b&gt;&lt;/span&gt;\n            &lt;br&gt;\n\n\n\n\n       
  &gt; &lt;span&gt;paint color: &lt;b&gt;white&lt;/b&gt;&lt;/span&gt;\n            &lt;br&gt;\n\n\n\n\n    
  &gt; &lt;span&gt;size: &lt;b&gt;full-size&lt;/b&gt;&lt;/span&gt;\n            &lt;br&gt;\n\n\n\n\n       
  &gt; &lt;span&gt;title status: &lt;b&gt;clean&lt;/b&gt;&lt;/span&gt;\n            &lt;br&gt;\n\n\n\n\n   
  &gt; &lt;span&gt;transmission: &lt;b&gt;automatic&lt;/b&gt;&lt;/span&gt;\n           
  &gt; &lt;br&gt;\n\n\n\n\n            &lt;span&gt;type: &lt;b&gt;mini-van&lt;/b&gt;&lt;/span&gt;\n        
  &gt; &lt;br&gt;\n\n    &lt;/p&gt;']
  </code></pre>
  <p>here's the rendered html:</p>
  <blockquote>
  <p>['\n\n\n\n            <b>2014 honda odyssey
  touring elite</b>\n            <br>\n\n    </p>', '\n\n\n\n            VIN:
  <b>5FNRL5H66EB107700</b>\n            <br>\n\n\n\n\n<br />
  condition: <b>like new</b>\n            <br>\n\n\n\n\n<br />
  cylinders: <b>6 cylinders</b>\n            <br>\n\n\n\n\n
  drive: <b>fwd</b>\n            <br>\n\n\n\n\n<br />
  fuel: <b>gas</b>\n            <br>\n\n\n\n\n<br />
  odometer: <b>99000</b>\n            <br>\n\n\n\n\n<br />
  paint color: <b>white</b>\n            <br>\n\n\n\n\n<br />
  size: <b>full-size</b>\n            <br>\n\n\n\n\n<br />
  title status: <b>clean</b>\n            <br>\n\n\n\n\n<br />
  transmission: <b>automatic</b>\n<br />
  <br>\n\n\n\n\n            type: <b>mini-van</b>\n<br />
  <br>\n\n    </p>']</p>
  </blockquote>
  <p>My questions are, how can i remove the html tags and how can I create keys from the span tags, which are:</p>
  <p>condition, drive, odometer, etc</p>
  <p>I'd like for the values returned from item[attributes] to create their own dict values such as:</p>
  <p>item[odometer]
  item[condition]
  etc</p>
  <p>Thanks so much for the help as I have been stuck on this for a while!</p>