Пример #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
Пример #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
Пример #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
Пример #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