Skip to content

body.scrollHeight Error cause testing page fail to complete loading #191

Description

@lizicuenca

When I evaluate www.amazon.com on my build, the tool shows the total page weight is only 19.8KB with 2 requests. In the JS Timeline, I found "TypeError: null is not an object (evaluating 'body.scrollHeight')" as the third row in the table. And nothing else is loaded after the JS error.

When I run phantomas directly, I got success result. There are 46 requests and 2MB of bodySize.
DEBUG=* phantomas "http://www.amazon.com" --verbose

So search around and found a thread mention about getting phamtonJS viewport. Here is what get when run phantomjs from the server.
ubuntu@ip:~$ phantomjs pageHeight.js { "document.body.scrollHeight": 9605, "document.body.offsetHeight": 9605, "document.documentElement.clientHeight": 300, "document.documentElement.scrollHeight": 9605 }
Sample code is copy from this thread: http://stackoverflow.com/questions/31245553/how-to-get-the-height-of-a-full-html-page-in-phantomjs-javascript

However, when I test amazon.com in http://yellowlab.tools/, this is no issue. Unfortunary, my site is running same error for every page. Can't use this tool now :(

nodejs: v6.4.0
npm: 3.10.3
phantomjs: 2.1.1
YellowLabTools: download from git 3 days ago.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions