1
1
mirror of https://github.com/ariya/phantomjs.git synced 2024-08-15 15:50:34 +03:00

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
This commit is contained in:
Zachary T Jones 2018-05-30 09:16:45 -04:00 committed by Ariya Hidayat
parent c0944903c3
commit 9bbd1ab0a3

View File

@ -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);
}