Jump to content

How do I call a javascript function on remote website


DeX

Recommended Posts

I'm writing a PHP script to pull information from another website which I don't own. That website uses javascript for pagination, splitting data across 3 pages. They also have a function to list all their data on one page but it requires clicking the link on the page which runs a javascript AJAX call. I want to pull all that data with PHP but how do I emulate the Javascript AJAX call in my code so I can get all that data instead of just the first page? Even if I could just call that function and then parse the information it returns to me. Thanks.

Link to comment
Share on other sites

<script src="url"

 

That won't work for what the OP is wanting. He is wanting to automatically get content based on the execution of the JavaScript. But, it seems, he is just scraping the page. Can't execute JS from within PHP.

Link to comment
Share on other sites

Yes, I'm trying to pull a list of stores from a mall directory but they have the listing split across 3 pages and you browse the pages using javascript links. I want to pull all the stores from the 3 pages. More specifically they have a Javascript link for returning all stores, I want that one.

 

EDIT: This one - http://www.crossironmills.com/shopping/store-directory/alpha/

Link to comment
Share on other sites

  • 2 weeks later...

So like a popup on the page?

No, they're using pagination to display 20 results at a time. You click the arrow and it displays the next 20 results. I want to somehow get all the results using a HTTP GET request on my own PHP page.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.