监督
我正在用Python编写脚本,该脚本的目标是使用请求使网站上的结帐过程自动化。
我已经完成了99%,最后一步是提交付款,为此,我需要在页面加载后由下面的JS在HTML中创建的参数。
JavaScript
我可以看到在Chrome“源”部分中运行的JS如下:
https://songbird.cardinalcommerce.com/edge/v1/songbird.js https://secure.louisvuitton.com/static/20.15.1-RC/min/scripts/cardinalCybs.js https://songbird.cardinalcommerce.com/edge/v1/60b72a99f75c34959d37/1.60b72a99f75c34959d37.songbird.js https://songbird.cardinalcommerce.com/edge/v1/60b72a99f75c34959d37/12.60b72a99f75c34959d37.songbird.js https://songbird.cardinalcommerce.com/edge/v1/60b72a99f75c34959d37/11.60b72a99f75c34959d37.songbird.js https://songbird.cardinalcommerce.com/edge/v1/60b72a99f75c34959d37/5.60b72a99f75c34959d37.songbird.js
HTML
<!-- START - The following JSP handles the Cardinal Javascripts , inclusion , initialization and all the other cardinal Specific mechanism -->
<!-- The Below JSP is invoked in case of a Credit Card Payment . Its an integration point with the Cardinal Commerce -->
<script src="https://songbird.cardinalcommerce.com/edge/v1/songbird.js"></script>
<script type="text/javascript" src="https://secure.louisvuitton.com/static/20.15.1-RC/min/scripts/cardinalCybs.js"></script>
<input type="hidden" id="JWTContainer" value=""/>
<input type="hidden" id="cardinalJSLogging" value="off"/>
<!-- END - The following JSP handles the Cardinal Javascripts , inclusion , initialization and all the other cardinal Specific mechanism -->
我可以看到此JS创建的请求,然后这些请求与支付网关进行交互,以检索发送完整结帐请求所需的参数。
由于使用了JWT令牌并且我没有密钥,因此如果没有运行JS,我不可能复制请求。
我的问题:如何运行JavaScript文件,发送其正常请求并反馈结果参数以完成结帐?
我的想法是使用答案https://stackoverflow.com/a/50612469/8840275中的类似方法建议,并使用Docker + Splash。
我不想使用硒。