I have recently completed my Selenium Python scraper. It works totally fine when I run it on my personal machine but the results are not same when I run it on the server. On the server I am running headless using pyvirtualdisplay
browser.get('https://example.com')
html = browser.page_source
And this is my code for pyvirtualdisplay.
display = Display(visible=0, size=(800, 600))
display.start()
While running on local machine, it totally grabs the HTML which is generated by JavaScript but when I run it on my server it doesn't grabs the HTML content generated by JavaScript, so I end up with only a partial page with none of the JS generated content.
Update: I have also took screenshots as per suggestions using Selenium. Screenshot shows that the page is partially loaded and the content by JS isn't loaded onto the screen.