title: Python Spider: Extract certain word form results
body: <p>I'm trying to figure out how I can extract only a part of text in a list.</p>
  
  <p>Below is my script that I'm currently use:</p>
  
  <pre><code>import scrapy.selector 
  import urlparse
  from scrapy.spiders import Spider
  from scrapy.http import Request
  from MediaMarkt.items import MediamarktItem
  
  
  def complete_url(string):
      return "http://www.mediamarkt.be" + string
  
  
  def encode(str):
      return str.encode('utf8', 'ignore') 
  
  
  class MshbeSpider(Spider):
      name = "mshbetv"
      start_urls = ['http://www.mediamarkt.be/mcs/productlist/_TV,98952,452540.html?langId=-17']
  
      def parse(self, response):
          items = response.xpath('//*[@id="filters"]/form/fieldset[2]/div[2]/ul[2]/li/a/@href')
          for item in items:
              link = item.extract()
              yield Request(link, callback=self.parse_category)
  
      def parse_category(self, response): 
          items = response.xpath('//ul[@class="products-list"]/li/div')
          for item in items:
              mshtv = MediamarktItem()
              mshtv['item_3_price'] = encode(item.xpath('normalize-space(.//aside/div/div/div/text())').extract()[0]).replace("-","")
              mshtv['item_2_name'] = encode(item.xpath('normalize-space(.//div/h2/a/text())').extract()[0])
              mshtv['item_a_link'] = complete_url(item.select('.//div/h2/a/@href').extract()[0])
              mshtv['item_4_avai'] = encode(item.xpath('normalize-space(.//aside/div/div/ul/span/text())').extract()[0])
              mshtv['item_1_cat'] = encode(item.xpath('normalize-space(//*[@id="category"]/hgroup/h1/text())').extract()[0])
              yield mshtv
  
  
          new_link = response.xpath('//li[@class="pagination-next"]/a/@href').extract()[0]
          yield Request(complete_url(new_link),callback=self.parse_category)
  </code></pre>
  
  <p>The field "mshtv['item_2_name'] " is where I want to extract only certain text.
  If tried everything that I could find but without succes.</p>
  
  <p>With my current script the results I'm getting for "mshtv['item_2_name']" are for example</p>
  
  <ul>
  <li><p>TV SAMSUNG UE55J6200AWXXN 55" LCD FULL LED Smart TV SONY</p></li>
  <li><p>KDL55W755CBAEP 55" LCD EDGE LED Smart</p></li>
  <li><p>TV SONY KD55-X9405CBAEP 55" 4K</p></li>
  </ul>
  
  <p>I have a hole list of the correct manufactor model numbers. As in this example they are</p>
  
  <ul>
  <li>UE55J6200AWXXN</li>
  <li>KDL55W755CBAEP</li>
  <li>KD55X9405CBAEP</li>
  </ul>
  
  <p>What I want to achieve is that while running my script I'm only getting the manufactor model numbers as return.</p>
  
  <p>Is this uberhaupt possible?</p>