Ruby on Rails屏幕抓取错误-“;您必须在浏览器中启用javascript才能使用此应用程序"

Ruby on Rails screen scrape error - "You must enable javascript in your browser to use this application"

本文关键字:javascript 启用 quot 应用程序 浏览器 抓取 屏幕 Rails on 取错误 Ruby      更新时间:2024-03-21

我有一个RubyonRails web应用程序,需要在其中进行一些屏幕抓取。

这是我的一般电话:

curl_results=#{kinit_command} curl -o curl_results.html -s -L --negotiate -u : '"http://yay.this.site.scrapes.fine'"

我在curl_results.html文件中得到了很多结果。

然而,当我尝试创建某些明显使用javascript的网站时,我在curl_results.html中得到了以下内容,其他什么都没有。。。

<noscript>
<div class="message">You must enable javascript in your browser to use this application.    </div>
</noscript>

有什么建议吗?

提前感谢,Tim

服务器可能拒绝curl作为用户代理。您是否尝试过将用户代理(带选项-A)更改为最近的chrome用户代理字符串(例如"Mozilla/5.0(Windows NT 6.1)AppleWebKit/537.36(KHTML,如Gecko)chrome/310.1650.57 Safari/537.36 OPR/18.0.1284.49")?