How to use execjs to execute JavaScript with Chinese parameters in Python
This article is about how Python uses execjs to execute JavaScript with Chinese parameters. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
A piece of JavaScript code containing data was crawled:
Import reimport requestsheaders = {"user-agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36", "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3" Res = requests.get ("https://www.kuaikanmanhua.com/web/comic/100868/", headers=headers) script = re.findall (" window.__NUXT__= ([^) ")