0

I am having a trouble with my script. It is supposed to download html from another website and use some specific data and output it to my website. But the website I need to download the html from uses javascript to generate some important data. How can I download the html after javascript has loaded, and use ajax to sent it to php?

Before I was using the file_get_contents, but that only downloads the raw html.

3
  • 2
    Get the HTML via PHP and then parse it with it, do the animation with jQuery afterward, what have you tried so far ? Commented May 15, 2015 at 8:25
  • I am totally lost, I haven't no idle how I can do it. I am just asking what would be the best way to handle this. Commented May 15, 2015 at 8:29
  • You have to think on how to execute your own js code from the web-target domain. I mean, you need to use something like Windows.Forms.WebBrowser, which gives you the ability to execute javascript. So, you have to load the page, then execute the same JS than the web executes by ajax by itself. Commented May 15, 2015 at 9:31

1 Answer 1

1

You should take a look to a headless browser, i only know https://github.com/ariya/phantomjs PhantomJs, but i'm sure there are others.

Sign up to request clarification or add additional context in comments.

2 Comments

Is not possible to do this without using PhantomJs
you can look to this thread there is others solutions :stackoverflow.com/questions/6578132/php-headless-browser. But it's better to use well done libraries instead of recreating the wheel.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.