Edit userAgent in Selenium Nodes

Thanks qqilihq for your nice talk of introducing the Selenium nodes in Berlin.

So now I would use them with the phantomJS browser but there are several webservices that block it's userAgent and I just get an empty page. There are some tips around how you could do this but there are all assume taht I start the browser from my own script (not from a knime node):

https://github.com/ariya/phantomjs/blob/master/examples/useragent.js

I've tried to set a key-value in the WebDriver Factory but this doesnt't work. Is there a way to pass the userAgent string as a variable or can I specify a standard in my OS for phantomJS ?

Hi Michael,

thank you for your feedback! Settings the UA is in fact already possible, though not very obvious (I'll try to make this more userfriendly in the future, as this is actually a quite popular feature request).

In the "WebDriver Factory" node create an entry with key "phantomjs.page.settings.userAgent" (mind the camel case) and specify the user agent as value. I've attached a simple example.

Hope that helps!

Best regards,
Philipp

Not very obvious but works very well. Thanks for your explanation!

edit: I guess this is related to this: http://phantomjs.org/api/webpage/property/settings.html