title: What's the correct Scrapy XPath for <p> elements incorrectly placed within <h> tags?
body: <p>I am setting up my first Scrapy Spider, and I'm having some difficulty using xpath to extract certain elements. </p>
  
  <p>My target is <a href="http://www.cbooo.cn/m/641515" rel="nofollow noreferrer">http://www.cbooo.cn/m/641515</a>  (a Chinese website similar to Box Office Mojo). I can extract the Chinese name of the film 阿龙浴血记 with no problem , but I can't figure out how to get the information below it. I believe this is because the HTML is not standard, as discussed <a href="https://stackoverflow.com/questions/44356281/extracting-p-within-h1-with-python-scrapy">here</a>. There are several paragraph elements nested beneath the  header.</p>
  
  <p>I have tried the solution in the link above, and also <a href="https://stackoverflow.com/questions/41063971/behavior-of-the-scrapy-xpath-selector-on-h1-h6-tags?noredirect=1&amp;lq=1">here</a>, to no avail. </p>
  
  <pre><code>def parse(self, response):
      chinesetitle = response.xpath('//*[@id="top"]/div[3]/div[2]/div/div[1]/div[2]/div[1]/h2/text()').extract()
      englishtitle = response.xpath('//*[@id="top"]/div[3]/div[2]/div/div[1]/div[2]/div[1]/h2/p').extract()
      chinesereleasedate = response.xpath('//*[@id="top"]/div[3]/div[2]/div/div[1]/div[2]/div[1]/p[4]').extract()
      productionregions = response.xpath('//*[@id="top"]/div[3]/div[2]/div/div[1]/div[2]/div[1]/p[6]').extract()
      chineseboxoffice = response.xpath('//*[@id="top"]/div[3]/div[2]/div/div[1]/div[2]/div[1]/p[1]/span/text()[2]').extract()
      yield {
          'chinesetitle': chinesetitle,
          'englishtitle': englishtitle,
          'chinesereleasedate': chinesereleasedate,
          'productionregions': productionregions,
          'chineseboxoffice': chineseboxoffice
          }
  </code></pre>
  
  <p>When I run the spider in the Scrapy shell, the spider finds the Chinese title as expected. However, the remaining items return either a [], or a weird mish-mash of text on the page.</p>
  
  <p>Any advice? This is my first amature programming project, so I appreciate your patience with my ignorance and your help. Thank you!</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Tried implement the text cleaning method in the comments. The example in the comments worked, but when I tried to reimplement it I got an "Attribute Error: 'list' object has no attribute 'split'“ (please see the China Box Office, country of origin, and genre examples below)</p>
  
  <pre><code>def parse(self, response):
          chinesetitle = response.css('.cont h2::text').extract_first()
          englishtitle = response.css('.cont h2 + p::text').extract_first()
          chinaboxoffice = response.xpath('//span[@class="m-span"]/text()[2]').extract_first()        
          chinaboxoffice = chinaboxoffice.split('万')[0]
          chinareleasedate = response.xpath('//div[@class="ziliaofr"]/div/p[contains(text(),"上映时间")]/text()').extract_first()
          chinareleasedate = chinareleasedate.split('：')[1].split('（')[0]
          countryoforigin = response.xpath('//div[@class="ziliaofr"]/div/p')[6].xpath('text()').extract_first()
          countryoforigin = countryoforigin.split('：')[1]
          genre = response.xpath('//div[@class="ziliaofr"]/div/p[contains(text(),"类型")]/text()').extract_first()
          genre = genre.split('：')[1]
          director = response.xpath('//*[@id="tabcont1"]/dl/dd[1]/p/a/text()').extract()
  </code></pre>