skip to Main Content

Python Web Scraping Beautiful Soup Parse Javascript Element and process variable – Shopify

I am trying to retrieve the variable in json format to python. url = "https://limitededt.com/collections/footwear/products/adidas-originals-jonah-hill-superstar-fw7577" source = requests.get(url).text soup = BeautifulSoup(source, 'lxml') print(soup.findAll('script')[10]) The code above produces: <script>window.ShopifyAnalytics = window.ShopifyAnalytics || {}; window.ShopifyAnalytics.meta = window.ShopifyAnalytics.meta || {}; window.ShopifyAnalytics.meta.currency = 'SGD';…

VIEW QUESTION
Back To Top
Search