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

textcontent of queryselector resulting Bad data #15367

Closed
yashwanth2804 opened this issue Apr 10, 2018 · 3 comments
Closed

textcontent of queryselector resulting Bad data #15367

yashwanth2804 opened this issue Apr 10, 2018 · 3 comments

Comments

@yashwanth2804
Copy link

yashwanth2804 commented Apr 10, 2018

  1. Which version of PhantomJS are you using? Tip: run phantomjs --version.
    2.1.1
  2. What steps will reproduce the problem?
    Run this script
var page = require('webpage').create();
console.log('The default user agent is ' + page.settings.userAgent);
 

page.settings.encoding = "utf8";
page.settings.userAgent = 'SpecialAgent';

page.open('https://openload.co/f/5GyL0zb1X0k', function(status) {
  if (status !== 'success') {
    console.log('Unable to access network');
  } else {
    var ua = page.evaluate(function() {
  
var j= document.querySelector('p#DtsBlkVFQx').textContent;
      return j;
    });

console.log(ua);
   
  }
  phantom.exit();
});
  1. Which operating system are you using?
    Windows 7

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

  3. Please provide any additional information below.

  • I want the element content with that particular id "DtsBlkVFQx" from that url
  • But what I am getting is some random asciis
    

I can able to get it from Puppeteer ,but I want it in Phantomjs .

@yashwanth2804
Copy link
Author

I am getting result like this AS┬ònO├ì{\z┬á├è├É∩┐ís├╜┬ñz☺♀├É∩╛╣↓3♂∩╛üp┬è6/┬àl┬»∩╛Ä├ì├▒♦;!┬ü(F , where it is actually 5GyL0zb1X0k~1523436534~103.81.0.0~tKvsvZhO

@t4style
Copy link

t4style commented Apr 18, 2018

I follow your question. I have a same problem ..

@ariya
Copy link
Owner

ariya commented Dec 25, 2019

Due to our very limited maintenance capacity (see #14541 for more details), we need to prioritize our development focus on other tasks. Therefore, this issue will be closed. In the future, if we see the need to attend to this issue again, then it will be reopened.
Thank you for your contribution!

@ariya ariya closed this as completed Dec 25, 2019
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

3 participants