Python change Accept-Language using requests -


i'm new python , trying infos imdb using requests library. code capturing data (e.g., movie titles) in native language, them in english. how can change accept-language in requests that?

all need define own headers:

import requests  url = "http://www.imdb.com/title/tt0089218/" headers = {"accept-language": "en-us,en;q=0.5"} r = requests.get(url, headers=headers) 

you can add whatever other headers you'd modify well.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -