phantomjs not loading instagram and pintersest webpages
Question: I'm using PhantomJS 2.1.1 in python 2.7.12 under Ubuntu Server 16.04.1, with
Display from pyvirtualdisplay

PhantomJS is unable to load instagram interactive dom pages
(<https://www.instagram.com/accounts/login/>). The page code should be within

    
    
    <span id="react-root"></span>
    

but it remains empty.

Instagram pages are correctly loaded with PhantomJS 2.1.1 in python 2.7.10
under Mac OS X 10.11.6; PhantomJS under Ubuntu Server can correctly load many
other website (twitter, tumblr etc), so I guess that there's some missing
module in Ubuntu Server but can't understand which one.

It can't neither load <https://www.pinterest.com/login/> but this page is
correctly loaded using simply curl.

Could someone help? Thank you.

Here's the python code:

    
    
    from selenium import webdriver
    from pytvirtualdisplay import Display
    
    display = Display(visible=0,size=(800,600))
    display.start()
    
    browser = webdriver.PhantomJS()
    browser.set_window_size(800, 600)
    browser.get('https://www.instagram.com/accounts/login/')
    

or

    
    
    browser.get('https://www.pinterest.com/login/')
    

the ghostdriver.log

    
    
    [INFO  - 2016-09-12T16:08:37.057Z] GhostDriver - Main - running on port 49739
    [INFO  - 2016-09-12T16:08:37.933Z] Session [2a14fc60-7903-11e6-a755-53e4799f55f3] - page.settings - {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.1.1 Safari/538.1","webSecurityEnabled":true}
    [INFO  - 2016-09-12T16:08:37.933Z] Session [2a14fc60-7903-11e6-a755-53e4799f55f3] - page.customHeaders:  - {}
    [INFO  - 2016-09-12T16:08:37.933Z] Session [2a14fc60-7903-11e6-a755-53e4799f55f3] - Session.negotiatedCapabilities - {"browserName":"phantomjs","version":"2.1.1","driverName":"ghostdriver","driverVersion":"1.2.0","platform":"linux-unknown-64bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
    [INFO  - 2016-09-12T16:08:37.934Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 2a14fc60-7903-11e6-a755-53e4799f55f3
    

* * *

Update: installing phantomjs with

    
    
    sudo apt-get install phantomjs
    

it correctly loads the entire page. But this package is missing some important
third-party dependencies (such as find_element Atom).

installing phantomjs with

    
    
    npm install phantomjs-prebuilt
    

it doesn't correctly load the page (even if it has got all third-party Atoms).

Is there a way to use the executable installed with apt-get and third-party
Atoms installed by npm?


Answer: SOLVED.

I solved compiling phantomjs on Ubuntu Server directly from git repository. So
maybe the pre-compiled binaries are not complete.

Details here: <http://phantomjs.org/build.html>

