# Edit userAgent in Selenium Nodes

**URL:** <https://forum.knime.com/t/edit-useragent-in-selenium-nodes/4195>\
**Category:** Community Extensions\
**Tags:** palladian-selenium\
**Created:** [March 6, 2016, 12:12pm UTC](https://forum.knime.com/t/edit-useragent-in-selenium-nodes/4195 "2016-03-06T12:12:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael\_prior](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/m/b5a626/32.png) [@michael\_prior](https://forum.knime.com/u/michael_prior)\
**Post date:** [March 6, 2016, 12:12pm UTC](https://forum.knime.com/t/edit-useragent-in-selenium-nodes/4195/1 "2016-03-06T12:12:43Z")

</div>

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](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 ?

---

<div class="post-metadata">

**Author:** ![qqilihq](https://forum-cdn.knime.com/user_avatar/forum.knime.com/qqilihq/32/50_2.png) [@qqilihq](https://forum.knime.com/u/qqilihq)\
**Post date:** [March 7, 2016, 5:38pm UTC](https://forum.knime.com/t/edit-useragent-in-selenium-nodes/4195/2 "2016-03-07T17:38:27Z")

</div>

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&nbsp;actually a quite popular feature request).

In the "WebDriver Factory" node create an entry&nbsp;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

- [phantomjsuseragent.zip](https://www.knime.com/sites/default/files/phantomjsuseragent.zip)

---

<div class="post-metadata">

**Author:** ![michael\_prior](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/m/b5a626/32.png) [@michael\_prior](https://forum.knime.com/u/michael_prior)\
**Post date:** [March 9, 2016, 6:17pm UTC](https://forum.knime.com/t/edit-useragent-in-selenium-nodes/4195/3 "2016-03-09T18:17:53Z")

</div>

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](http://phantomjs.org/api/webpage/property/settings.html)

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [April 21, 2023, 9:40pm UTC](https://forum.knime.com/t/edit-useragent-in-selenium-nodes/4195/4 "2023-04-21T21:40:39Z")

</div>

Closed on April 21, 2023, 9:40pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
