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
sm7b.
sm7b.OP16mo ago
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?
Chaika
Chaika16mo ago
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
sm7b.
sm7b.OP16mo ago
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
Kai
Kai16mo ago
Could be phantomjs doesn't support TLS 1.2 ootb still. See https://github.com/ariya/phantomjs/issues/13496
JustinNoel
JustinNoel16mo ago
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
sm7b.
sm7b.OP16mo ago
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
Want results from more Discord servers?
Add your server