I need to extract some data from a website, I found that all I need is exist in <script> element, So I extracted them with this command:
script = response.css('[id="server-side-container"] script::text').get()
And this is the value of script:
window.bottomBlockAreaHtml = '';
...
window.searchQuery = '';
window.searchResult = {
"stats": {...},
"products": {...},
...
};
window.routedFilter = '';
...
window.searchContent = '';
What is the best way to get the value of "products" in my python code?
scriptvariable?strjson.loads()productsfield. Post the url and I can show you an example