soma56 Posted December 13, 2010 Share Posted December 13, 2010 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? Quote Link to comment https://forums.phpfreaks.com/topic/221564-using-curl-to-get-links-on-a-page-not-found-in-soure-code/ Share on other sites More sharing options...
nafetski Posted December 13, 2010 Share Posted December 13, 2010 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! Quote Link to comment https://forums.phpfreaks.com/topic/221564-using-curl-to-get-links-on-a-page-not-found-in-soure-code/#findComment-1146935 Share on other sites More sharing options...
soma56 Posted December 13, 2010 Author Share Posted December 13, 2010 Thanks man. My head is spinning. I believe it's hard coded in Javascript. I'm going to try a few things and I'll post my 'success code', if I figure it out, here. In the mean time more suggestions are welcome. Quote Link to comment https://forums.phpfreaks.com/topic/221564-using-curl-to-get-links-on-a-page-not-found-in-soure-code/#findComment-1146938 Share on other sites More sharing options...
QuickOldCar Posted December 14, 2010 Share Posted December 14, 2010 Got a link to where you wanna get stuff from? You may be able to do it with simple html dom. http://simplehtmldom.sourceforge.net/ Quote Link to comment https://forums.phpfreaks.com/topic/221564-using-curl-to-get-links-on-a-page-not-found-in-soure-code/#findComment-1147018 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.