Ejemplo n.º 1
0
 def __init__(self, title, index, time, author, shici_pic, content):
     self.title = format_str_info(title)
     self.index = format_str_info(index)
     self.time = format_str_info(time)
     self.author = format_str_info(author)
     self.pic = format_str_info(shici_pic)
     self.content = content
Ejemplo n.º 2
0
 def get_info_from_movie(self, href):
     html_detail = self.get_html_text(href)
     com_html = etree.HTML(html_detail)
     movieLis = com_html.xpath('//*[@class="article"]/ol/li')
     movieList = []
     for movieItem in movieLis:
         image = movieItem.xpath('./div/div[@class="pic"]/a/img/@src')[0]
         index = movieItem.xpath('./div/div[@class="pic"]/em/text()')[0]
         subject = movieItem.xpath('./div/div[@class="info"]/div[@class="hd"]/a/@href')[0]
         title = movieItem.xpath('./div/div[@class="info"]/div[@class="hd"]/a/span/text()')[0]
         content_text = movieItem.xpath('./div/div[@class="info"]/div[@class="bd"]/p[1]/text()')
         # print(content_text)
         content1 = format_str_info(content_text[0]).split("   ")
         # print(content1)
         director = content1[0]
         actor = ''
         if len(content1) > 1:
             actor = content1[1]
         content2 = format_str_info(content_text[1]).split("/")
         # print(content2)
         mtime = content2[0]
         area = content2[1]
         mtype = content2[2]
         # print(mtime, area, mtype)
         score = movieItem.xpath('./div/div[@class="info"]/div[@class="bd"]/div/span[@class="rating_num"]/text()')[0]
         comment = movieItem.xpath('./div/div[@class="info"]/div[@class="bd"]/p[@class="quote"]/span/text()')
         if comment:
             comment = comment[0]
         # print(desc)
         movieBean = MovieBean(subject, title, image, score, comment, director, actor, mtime, area, mtype, index)
         movieList.append(movieBean)
     return movieList
Ejemplo n.º 3
0
 def __init__(self, name, colorFrom, colorTo, colorText):
     self.name = format_str_info(name)
     if colorFrom:
         self.colorValue = colorFrom + "→" + colorTo
     else:
         self.colorValue = 'Many colors'
     self.colorText = colorText
Ejemplo n.º 4
0
 def __init__(self, title, image, score, director, actor, duration, area):
     self.title = format_str_info(title)
     self.image = format_str_info(image)
     self.score = format_str_info(score)
     self.director = format_str_info(director)
     self.actor = format_str_info(actor)
     self.duration = format_str_info(duration)
     self.area = format_str_info(area)
Ejemplo n.º 5
0
 def __init__(self, name, value):
     self.name = format_str_info(name)
     self.value = format_str_info(value)
Ejemplo n.º 6
0
 def __init__(self, name, content):
     self.name = format_str_info(name)
     self.content = content
Ejemplo n.º 7
0
 def __init__(self, name, desc, books):
     self.name = format_str_info(name)
     self.desc = format_str_info(desc)
     self.books = books
Ejemplo n.º 8
0
 def __init__(self, subject, title, image, score, comment, director, actor, mtime, area, mtype, index):
     self.subject = format_str_info(subject)
     self.title = format_str_info(title)
     self.image = format_str_info(image)
     self.score = format_str_info(score)
     self.comment = format_str_info(comment)
     self.director = format_str_info(director)
     self.actor = format_str_info(actor)
     self.mtime = format_str_info(mtime)
     self.area = format_str_info(area)
     self.mtype = format_str_info(mtype)
     self.index = format_str_info(index)
Ejemplo n.º 9
0
 def __init__(self, title, time, author, content):
     self.title = format_str_info(title)
     self.time = format_str_info(time)
     self.author = format_str_info(author)
     self.content = content