我试图在Raspberri Pi上使用Scrapy初始加载后抓取一个由javascript修改的页面。
我尝试安装docker和scrapinghub / splash来渲染页面,然后将其传递给scrapy,但实现了Splash还不支持ARM。是否有其他选项可以在Raspberry Pi上使用带有Scrapy的JavaScript来抓取页面?
目前,在网站上使用正常的scrapy请求我只得到这个html,这是因为网站首先加载,然后javascript呈现整个内容。所以在javascript之前,页面源看起来是空的:
<body class="notie8 notie9 lang-{{html.lang}}">
<!--<![endif]-->
<div loading-line></div>
<div page-layout>
<div ng-view></div>
</div>
</body>
</html>
作为参考,我所指的网站是:https://www.sreality.cz/hledani/prodej/byty?region=brno
答案 0 :(得分:2)
Sreality uses API, isn't this a way to go? For your URL, there's this API call: https://www.sreality.cz/api/cs/v2/estates?category_main_cb=1&category_type_cb=1&per_page=20®ion=brno&tms=1502631428897 (look for XHR requests in your browser's developer tools).