Open cvjensen opened 3 months ago
I found this
response.html.xpath("//script[@id='__NEXT_DATA__']")[0].text
that returns ALOOOT more data like
nextdata = response.html.xpath("//script[@id='__NEXT_DATA__']")[0].text
nextdata = ''.join(nextdata.splitlines()) # removing newlines
nextdata = f"""{nextdata}"""
nextdata = json.loads(nextdata)
#print(json.dumps(nextdata, indent=2))
countries = [country['id'] for country in nextdata['props']['pageProps']['mainColumnData']['countriesOfOrigin']['countries']]
print(countries)
languages = [language['id'] for language in nextdata['props']['pageProps']['mainColumnData']['spokenLanguages']['spokenLanguages']]
print(languages)
python test.py
['US']
['en']
Is it possible to make PyMovieDb return Country of origin and Language also?