Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

useragent example uses outdated selector #15392

Closed
Zajn opened this issue May 30, 2018 · 1 comment
Closed

useragent example uses outdated selector #15392

Zajn opened this issue May 30, 2018 · 1 comment

Comments

@Zajn
Copy link
Contributor

Zajn commented May 30, 2018

  1. Which version of PhantomJS are you using? Tip: run phantomjs --version.
    2.1.1

  2. What steps will reproduce the problem?

  • Run phantomjs examples/useragent.js
  • Observe JavaScript error output
  1. Which operating system are you using?
    macOS 10.12.6

  2. Did you use binary PhantomJS or did you compile it from source?
    Binary

  3. Please provide any additional information below.
    When running the useragent.js example, I encountered some unexpected output:

The default user agent is Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.1.1 Safari/538.1
TypeError: null is not an object (evaluating 'document.getElementById('myagent').innerText')

  undefined:2
  :3
null

It seems that the DOM structure of www.httpuseragent.org has changed since this example was last updated.

Zajn added a commit to Zajn/phantomjs that referenced this issue May 30, 2018
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.

ariya#15392
Zajn added a commit to Zajn/phantomjs that referenced this issue May 30, 2018
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.

ariya#15392
ariya pushed a commit that referenced this issue Jun 2, 2018
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.

#15392
@ariya
Copy link
Owner

ariya commented Jun 2, 2018

Thanks for the pull request @Zajn! This should be fixed now.

@ariya ariya closed this as completed Jun 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants