[PYTHON] Check when the HTML obtained by Requests on Google App Engine is garbled

phenomenon

HTML fetched by Requests of Google App Engine (Python) is garbled. It works on the local terminal (not GAE) ... Searched and came out You can't change the encoding in the Requests manual. You can't try other acquisition methods such as contetns or json, I'm pretty clogged up, so I'll write down how to solve it.

The first thing to check

** Is the version of Requests you are using supported by GAE **?

In How to add Google App Engine library, It says to install with pip, but then the latest version will be installed.

However, the latest version does not seem to be supported on GAE I solved it by installing the 2.3 version based on the answer below.

I think you need to be careful not only for Requests but also for libraries that do not specify the version.

reference

Can Python Requests library be used on Google App Engine?

Recommended Posts

Check when the HTML obtained by Requests on Google App Engine is garbled
Use ndb.tasklet on Google App Engine
Publish the site for free on Google App Engine (personal memorandum)
[Python] Run Flask on Google App Engine
Use external modules on Google App Engine
Tweet (API 1.1) on Google App Engine for Python
Until you run a Flask application on Google App Engine for the time being
Deploy a Django application on Google App Engine (Python3)
(Beginner) Basic usage of Datastore on Google App Engine
Check if the LAN cable is disconnected on Linux
How to use Django on Google App Engine / Python
Deploy your Go app on Google App Engine with GitHub Actions