Splash 没有完全渲染网页

问题描述

我正在尝试使用 scrapy + splash scrape 本网站 https://www.teammitsubishihartford.com/new-inventory/index.htm?compositeType=new。但我无法从该网站提取任何数据。当我尝试使用飞溅 api(浏览器)渲染网页时,我发现该网站未完全加载(飞溅渲染返回部分加载的网站图像)。我怎样才能完整地呈现网站?

解决方法

@Vinu Abraham,如果您的要求不是针对 scrapy + splash,则可以使用 selenium。当我们尝试抓取动态站点时会出现此问题。 以下是供参考的代码片段。

it('should test menu',() => {
    spyOn(menuSpy,'shouldHighlight').and.returnValue(true);
    spyOn(menuService,'getMenus').and.returnValue(MENUS);
    fixture = TestBed.createComponent(MenuComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
   // Component assertions 
  });

如果您使用scrapy获得相同的解决方案,也请告诉我。