예제 #1
0
    def __init__(self, api, soup, Id, ItemId):
        self.soup = soup.find("div", id=Id)
        if not self.soup:
            warnings.warn(
                "We were not able to find the review HTML for {} perhaps this means "
                "that the parser is broken. File a bug".format(Id))
            raise ValueError()

        self.api = api
        self._asin = ItemId
        self._id = Id
        self._url = review_url(self._id)
예제 #2
0
    def __init__(self, api, Id=None, URL=None):
        if Id and not URL:
            if 'amazon' in Id:
                raise ValueError('URL passed as ID')

            URL = review_url(Id)

        if not URL:
            raise ValueError('Invalid review page parameters')

        self.api = api
        self._URL = URL
        self._soup = None
예제 #3
0
    def __init__(self, api, Id=None, URL=None):
        if Id and not URL:
            if 'amazon' in Id:
                raise ValueError('URL passed as ID')

            URL = review_url(Id)

        if not URL:
            raise ValueError('Invalid review page parameters')

        self.api = api
        self._URL = URL
        self._soup = None
예제 #4
0
    def __init__(self, api, soup, Id, ItemId):
        self.soup = soup.find("div", id=Id)
        if not self.soup:
            warnings.warn(
                "We were not able to find the review HTML for {} perhaps this means "
                "that the parser is broken. File a bug".format(Id)
            )
            raise ValueError()

        self.api = api
        self._asin = ItemId
        self._id = Id
        self._url = review_url(self._id)
예제 #5
0
    def __init__(self, reviews_soup, review_id, product_asin):
        self.soup = reviews_soup.find("div", id=review_id)
        if not self.soup:
            warnings.warn(
                "We were not able to find the review HTML for {} perhaps this means "
                "that the parser is broken. File a bug".format(review_id))
            raise ValueError()

        self._asin = product_asin
        self._author = None
        self._author_reviews_url = None
        self._date = None
        self._rating = None
        self._text = None
        self._title = None
        self._id = review_id
        self._url = review_url(self._id)
예제 #6
0
    def __init__(self, reviews_soup, review_id, product_asin):
        self.soup = reviews_soup.find("div", id=review_id)
        if not self.soup:
            warnings.warn(
                "We were not able to find the review HTML for {} perhaps this means "
                "that the parser is broken. File a bug".format(review_id)
            )
            raise ValueError()

        self._asin = product_asin
        self._author = None
        self._author_reviews_url = None
        self._date = None
        self._rating = None
        self._text = None
        self._title = None
        self._id = review_id
        self._url = review_url(self._id)
예제 #7
0
 def url(self):
     return review_url(self.id)
예제 #8
0
 def urls(self):
     return [review_url(id) for id in self.ids]
예제 #9
0
 def urls(self):
     return [
         review_url(id)
         for id in self.ids
     ]
예제 #10
0
 def url(self):
     if not self._review_url:
         self._review_url = review_url(self._id)
     return self._review_url
예제 #11
0
 def url(self):
     if not self._review_url:
         self._review_url = review_url(self._id)
     return self._review_url