Example #1
0
 def soup(self):
     if not self._soup:
         rate_limit(self.api)
         r = requests.get(self._URL, headers={'User-Agent':user_agent}, verify=False)
         r.raise_for_status()
         self._soup = BeautifulSoup(r.text, 'html5lib')
     return self._soup
Example #2
0
 def soup(self):
     if not self._soup:
         rate_limit(self.api)
         r = requests.get(self._URL,
                          headers={'User-Agent': user_agent},
                          verify=False)
         r.raise_for_status()
         self._soup = BeautifulSoup(r.text, 'html5lib')
     return self._soup
Example #3
0
 def soup(self):
     # lazily load the soup
     # otherwise we will slow down simple operations
     if not self._soup:
         url = product_url(self.asin)
         rate_limit(self.api)
         # verify=False ignores SSL errors
         r = requests.get(url, headers={'User-Agent':user_agent}, verify=False)
         r.raise_for_status()
         #self._soup = BeautifulSoup(r.text, 'html.parser')
         self._soup = BeautifulSoup(r.text, 'html5lib')
     return self._soup
Example #4
0
 def soup(self):
     # lazily load the soup
     # otherwise we will slow down simple operations
     if not self._soup:
         url = product_url(self.asin)
         rate_limit(self.api)
         # verify=False ignores SSL errors
         r = requests.get(url,
                          headers={'User-Agent': user_agent},
                          verify=False)
         r.raise_for_status()
         #self._soup = BeautifulSoup(r.text, 'html.parser')
         self._soup = BeautifulSoup(r.text, 'html5lib')
     return self._soup