Fix for newer BS4?
This commit is contained in:
parent
896bdd1572
commit
97589e4645
|
@ -11,7 +11,7 @@ class Bollycao():
|
|||
def get_price(self):
|
||||
content = self.requests.get(self.url).content
|
||||
soup = BeautifulSoup(content, 'html.parser')
|
||||
data_layer = soup.find('script', text=re.compile('dataLayer')).text
|
||||
data_layer = soup.find('script', text=re.compile('dataLayer')).string
|
||||
|
||||
return float(json.loads(data_layer.split('=', 2)[-1][:-1])[0]['product']['price']['final'])
|
||||
|
||||
|
|
Loading…
Reference in New Issue