From 9bbd1ab0a3b6de7da15305cf0529f2a9079441ea Mon Sep 17 00:00:00 2001 From: Zachary T Jones Date: Wed, 30 May 2018 09:16:45 -0400 Subject: [PATCH] Update selector in useragent example to prevent TypeError The DOM structure of the page that is retrieved by useragent.js has changed since the example was last updated, and the selector for the user agent value no longer exists. This causes a TypeError to be output to the user when running the example. This updates the example to use a selector that exists on the page. https://github.com/ariya/phantomjs/issues/15392 --- examples/useragent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/useragent.js b/examples/useragent.js index 5a48091a3..802800cc5 100644 --- a/examples/useragent.js +++ b/examples/useragent.js @@ -7,7 +7,7 @@ page.open('http://www.httpuseragent.org', function (status) { console.log('Unable to access network'); } else { var ua = page.evaluate(function () { - return document.getElementById('myagent').innerText; + return document.getElementById('qua').value; }); console.log(ua); }