PhantomJS headless browser being blocked.
I am using PhantomJS to take a screenshot of my website.
The connection to my site fails everytime while my site is proxied through cloudflare. If i turn off proxying it connects fine and phantomjs can take a screenshot of my website.
What configuration in cloudflare could be causing this??? I have another site hosted on same VPS and also on cloudflare that PhantomJS can crawl while my site is proxied through cloudflare.
I assume there is some kind of configuration within cloudflare but i have tried but with no luck
6 Replies
Update:
https://matthews.screenshot-server.com/ss/W6imY
disabling always use https fixed my issue with my main domain.
however my other domain has always use https enabled and its not an issue for my crawler to access the site.?
Im kind of glad i found "a solution" but its just confused me more lmao anyone got any ideas?
It looks like phantomjs is abandonded/dead and you might want to use something like puppeteer instead.
disabling always use https fixed my issue with my main domain.That's a strange fix though, it sounds like you're simply trying to fetch the website over http instead of https and phantomjs isn't following the redirect
Yeah i was gonna look into trying puppeteer at some point.
I looked into it a little more and for some reason it gives error code 6 SSL Handshake failed.
but tbh not sure why that would be or what would cause it
Could be phantomjs doesn't support TLS 1.2 ootb still. See https://github.com/ariya/phantomjs/issues/13496
Also consider Playwright. I found it very easy and powerful.
https://playwright.dev
Fast and reliable end-to-end testing for modern web apps | Playwright
Cross-browser end-to-end testing for modern web apps
I run phantomjs with --ignore-ssl-errors true and it works fine, I just dont know whats wrong with my site or cloudflares ssl for that to happen to just the one of my sites.
I liked phantomjs because all It was incredibly easy to setup and get running, However yeah ill take a look at some other options like playwright and puppeteer.
Thanks guys