Home > other >  How elegant patch system module?
How elegant patch system module?

Time:02-27

Recently the crawler should use execjs library to perform a js, but this is a period of js utf8 encoding, lead to failure,

The code is as follows:
 
With the open (' main. Js, encoding='utf8') as fr:
TXT=fr. Read ()
Js=execjs.com running (TXT)
Js. Call (' fun ') # the subprocess. Call in call Popen, but encodeing default is GBK, result in abnormal,


Online to find solution are directly to the source code, there are other more elegant solution?
  • Related