Answer the question
In order to leave comments, you need to log in
How to pull this in python?
I made a page parser, what I needed was in the script tag, I pulled out the content of this tag
<script>
window.settings ={"feedPrefix":"dnevnik","rootUrl":"https://kundelik.kz","apiUrl":"https://kundelik.kz/api","environmentPrefix":"kz"};
</script>
Answer the question
In order to leave comments, you need to log in
import re
import json
string ='''<script>
window.settings ={"feedPrefix":"dnevnik","rootUrl":"https://kundelik.kz","apiUrl":"https://kundelik.kz/api","environmentPrefix":"kz"};
</script>'''
r = re.search("window.settings =(.*);", string)
if r:
dic = json.loads(r.groups()[0])
print(dic["feedPrefix"])
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question