(self, html)
return { 'titles': [page_div.find('h2').string],
                 'dates': [page_div.find('span', class_='date').string],
                 'descriptions': [" ".join(text_div.find('p').strings)],
                 'tags': [x.find('a').string for x in page_div.find_all('span', class_='tag')],
                 'images': [x.attrs['src'] for x in text_div.find_all('img')],
                 }
Extract data from lethain.com.
Extract data from lethain.com.
Extract data from lethain . com .
def extract(self, html):
        "Extract data from lethain.com."
        soup = BeautifulSoup(html, features="html5lib")
        page_div = soup.find('div', class_='page')
        text_div = soup.find('div', class_='text')
        return { 'titles': [page_div.find('h2').string],
                 'dates': [page_div.find('span', class_='date').string],
                 'descriptions': [" ".join(text_div.find('p').strings)],
                 'tags': [x.find('a').string for x in page_div.find_all('span', class_='tag')],
                 'images': [x.attrs['src'] for x in text_div.find_all('img')],
                 }
def extract ( self , html ) : soup = BeautifulSoup ( html , features = "html5lib" ) page_div = soup . find ( 'div' , class_ = 'page' ) text_div = soup . find ( 'div' , class_ = 'text' ) return { 'titles' : [ page_div . find ( 'h2' ) . string ] , 'dates' : [ page_div . find ( 'span' , class_ = 'date' ) . string ] , 'descriptions' : [ " " . join ( text_div . find ( 'p' ) . strings ) ] , 'tags' : [ x . find ( 'a' ) . string for x in page_div . find_all ( 'span' , class_ = 'tag' ) ] , 'images' : [ x . attrs [ 'src' ] for x in text_div . find_all ( 'img' ) ] , }