Answer the question
In order to leave comments, you need to log in
Get JSON variable from BeautifulSoup Python?
How to get json variable (window.detailData) from this pretty text
window.__version__map = {
'magicEditLoaderVersion': '0.0.75',
'icbuPcDetailAll': '0.0.9'
}
window.detailData = {"globalData":{"asddsa":true}, "renderType":"js_ssr"} }}
Answer the question
In order to leave comments, you need to log in
It's just in the page code, right? Better get it regularly.
import re
html = '''window.__version__map = {
'magicEditLoaderVersion': '0.0.75',
'icbuPcDetailAll': '0.0.9'
}
window.detailData = {"globalData":{"asddsa":true}, "renderType":"js_ssr"}}}'''
data = re.search(r'window.detailData = (.+?)$', html).group(1)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question