Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to enable the web driver? #46

Open
Zimaell opened this issue Aug 22, 2019 · 1 comment
Open

How to enable the web driver? #46

Zimaell opened this issue Aug 22, 2019 · 1 comment
Assignees

Comments

@Zimaell
Copy link

Zimaell commented Aug 22, 2019

How to enable the web driver, I check for availability on this service
https://intoli.com/blog/not-possible-to-block-chrome-headless/chrome-headless-test.html
When using MTS, it shows that it is disabled ...
How can I turn it on?

This my code
require(ROOT.'/vendor/autoload.php'); $browserObj=\MTS\Factories::getDevices()->getLocalHost()->getBrowser('phantomjs'); $browserObj->setKeepalive(true); $browserObj->setDefaultExecutionTime(60000); $windowObj=$browserObj->getNewWindow(); $windowObj->setUserAgent('Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0'); $windowObj->setUrl('https://intoli.com/blog/not-possible-to-block-chrome-headless/chrome-headless-test.html'); $content=$windowObj->getDom(); $browserObj->terminate();

The ultimate goal is to make the request look like a real browser, and not be recognized as headless ...

@merlinthemagic
Copy link
Owner

Hi,

You can append the PhantomJS options by modifying this line.

PhantomJS does support remote webdriver for e.g. selenium integration, but thats not going to help you make the browser mimic the behaiviour of your regular browser.

The maintainers of PhantomJS stopped development a few years ago, you are far better off implementing Chrome headless rather than relying on PhantomJS.

@merlinthemagic merlinthemagic self-assigned this Sep 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants