Answer the question
In order to leave comments, you need to log in
How to get the data if the div is empty, and the site displays data in this div?
There is a website.
I'm trying to get data from there, from , there is a name, phone number, etc., but when I click to see the page code, there is nothing in this div-e.
Therefore, I can't parse anything.
There is only a big script like
({"cities":{"74858":{"name":"\u0420\u043e\u0441\u0441\u0438\u044f","code":"rossiya","id":"74858","title":"\u041c\u0430\u0433\u0430\u0437\u0438\u043d\u044b LIME \u0432 \u0420\u043e\u0441\u0441\u0438\u0438 | \u041a\u0430\u0440\u0442\u0430","description":"LIME \u2014 \u043c\u0430\u0440\u043a\u0430 \u0431\u0440\u0435\u043d\u0434\u043e\u0432\u043e\u0439 \u0436\u0435\u043d\u0441\u043a\u043e\u0439 \u043e\u0434\u0435\u0436\u0434\u044b \u0438 \u0430\u043a\u0441\u0435\u0441\u0441\u0443\u0430\u0440\u043e\u0432. \u041c\u044b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043c\u043e\u0434\u043d\u044b\u0435 \u0442\u0435\u043d\u0434\u0435\u043d\u0446\u0438\u0438 \u043f\u043e \u0432\u044b\u0433\u043e\u0434\u043d\u043e\u0439 \u0446\u0435\u043d\u0435. \u041d\u0430\u0439\u0442\u0438 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439 \u043c\u0430\u0433\u0430\u0437\u0438\u043d \u043d\u0430\u0448\u0435\u0439 \u0441\u0435\u0442\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0432 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435.","keywords":"\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u044b lime \u0440\u043e\u0441\u0441\u0438\u044f \u043a\u0430\u0440\u0442\u0430"
Answer the question
In order to leave comments, you need to log in
import requests
import json
import re
r = requests.get("https://lime-shop.ru/shops/moskva/")
a = json.loads(re.search("_shops\.init\((.*?)\);", r.text).group(1))
for shop in a['shops']:
print(shop['caption'])
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question