在请求页面加载后呈现JavaScript内容以检索参数
概览 我正在用Python编写一个脚本,该脚本的目标是使用请求自动化网站上的签出过程 我已经完成了99%,最后一步是提交付款,为此我需要在页面加载后在HTML中由下面的JS创建参数 JavaScript 我可以在Chrome的“源代码”部分看到的JS如下所示: HTML在请求页面加载后呈现JavaScript内容以检索参数,javascript,python,automation,python-requests,Javascript,Python,Automation,Python Requests,概览 我正在用Python编写一个脚本,该脚本的目标是使用请求自动化网站上的签出过程 我已经完成了99%,最后一步是提交付款,为此我需要在页面加载后在HTML中由下面的JS创建参数 JavaScript 我可以在Chrome的“源代码”部分看到的JS如下所示: HTML <!-- START - The following JSP handles the Cardinal Javascripts , inclusion , initialization and all the othe
<!-- 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文件运行、发送它们的正常请求并反馈结果参数以完成签出
我的想法是使用这个答案中类似的方法建议,并使用Docker+Splash
我不想使用Selenium。我尝试过使用requests\u html模块,但在查看响应时,我得到了“拒绝访问”我尝试过使用requests\u html模块,但在查看响应时,我得到了“拒绝访问”