There is some code that normally runs on your computer. When you try to run it on the vds server (Ubuntu 16), an error crashes. The server is almost empty, so it is highly probable that something is missing there.

Tell me why this can be, how to fix it.

Code:

code

Mistake:

enter image description here

  • text information is better to attach as text: a) easier to read; b) can be copied; c) the search works. You can correct the question text by clicking below to edit the question text - aleksandr barakin

2 answers 2

In this case, text is a property, not a method. Remove brackets after it.

  • Previously, and did. But with this modification, another error appears. UnicodeEncodeError: 'ascii' codec can't encode characters in position 5048-5052: ordinal not in range(128) - Oskar Sharipov
  • @ OskarSharipov the second error has nothing to do with the requests module. This is about the encoding. - Vladimir Martyanov
  • I did not say that this is an error requests. I ask for help and warned that the server is empty, so something is missing there. - Oskar Sharipov
  • Interestingly, everything is fine on a computer under windows - Oskar Sharipov
  • This is already a problem with the locale. it’s better to configure it, but you can try adding a .decode('utf-8') method .decode('utf-8') to the text property - ArcherGodson

Decision:

enter image description here

But this does not mean that I do not wait for an explanation, why do I need to encode

  • text information is better to attach as text: a) easier to read; b) can be copied; c) the search works. correct the answer text by clicking edit - aleksandr barakin