Jump to content

Using cURL to get links on a page (not found in soure code)


soma56

Recommended Posts

Well this is a tricky one for me. The script I've created is able to upload images to a server. The server, which I have no control over, generates a random name. It uses Javascript and flash. As a result the links to these images are not within the source code.

 

I suppose the question is, is there a way to still grab these links? I'm familiar with cURL and I was thinking about using something like (CURLOPT_FOLLOWLOCATION) but I'm wondering if that would just look at the source code for links as well?

 

Has anyone had this problem before?

Yep, common problem.

 

Before writing a line of PHP you will want to find out EXACTLY how the links are being formed.  Whether they are being pulled in via an ajax call, hard coded in a JS file, etc.

 

If it's from an ajax call - you'll have to replicate that as well with CURL (remember, just because it's ajax doesn't make it special.  Can still send the same headers and (in theory) get the same response).

 

If it's hardcoded in javascript, you will need to pull down that file and parse it's contents.

 

It's a dirty job, but if it was easy everyone would be doin it! ;)

 

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.