scrapy 调用js

依赖:

PyExecJS

 

使用案例:

from execjs import execjs  

text = response.xpath('//script/text()')[1].get() 
ctx = execjs.compile(text) 
# ctx 有call调用js函数
# eval 获取js变量

  

 

posted @ 2019-10-07 00:56  apuyuseng  阅读(1119)  评论(0编辑  收藏  举报