コード例 #1
0
 def parse_actor(self, element):
     cinema = Component()
     cinema.type = "Actor"
     cinema.alignment = "LEFT"
     cinema.page_url = self.get_from_page(element, "./div[2]/p/a", "href")
     cinema.title = self.get_from_page(element, "./div[2]/p/a", "string")
     cinema.snippet = self.get_from_page(element, "./div[2]/span[2]",
                                         "string")
     cinema.image = self.get_from_page(element, "./p/a/img", "src")
     return cinema
コード例 #2
0
 def parse_evaluated_cinema(self, element):
     cinema = Component()
     cinema.type = "EvaluatedCinema"
     cinema.alignment = "LEFT"
     cinema.page_url = self.get_from_page(element, "./div[2]/p/a", "href")
     cinema.title = self.get_from_page(element, "./div[2]/p/a", "string")
     cinema.snippet = self.get_from_page(element, "./div[2]/span[2]",
                                         "string")
     cinema.actors = self.get_from_page(element, "./div[2]/span[3]",
                                        "string")
     cinema.year = self.get_from_page(element, "./div[2]/p/span", "string")
     cinema.value = self.get_from_page(element, "./div[1]/div", "string")
     cinema.image = self.get_from_page(element, "./p/a/img", "src")
     return cinema