e1seix Posted December 30, 2007 Share Posted December 30, 2007 I have a bit of a loose question, which I'm sad to say the answer is probably "No" but I wanted some advice. Is there a way of lifting variable information from an external website using PHP? An example: I have an affiliate site which links to various product websites. The external websites continually vary the prices of certain products meaning that I have to keep an eye on this and update it in MySQL. An effort when you've over 700 products to keep track of from day to day. Is there a way of scanning the related link's source code for the text, say "Our Price £27.50" and having this update mysql automatically... I know how to do the update bit, but the scanning thing is a big question mark for me... hmm... thank you and a happy new year Quote Link to comment https://forums.phpfreaks.com/topic/83732-lifting-variable-info-from-a-webpage/ Share on other sites More sharing options...
revraz Posted December 30, 2007 Share Posted December 30, 2007 Sure, you can load in source from any webpage and design your own filters to pull what you want from it. Quote Link to comment https://forums.phpfreaks.com/topic/83732-lifting-variable-info-from-a-webpage/#findComment-426010 Share on other sites More sharing options...
anon Posted December 30, 2007 Share Posted December 30, 2007 What you'll need to do is design a script which downloads the HTML. You can use cURL or file_get_contents (the latter being easier). Then, you'll want to use regex (regular expressions) to filter the HTML anything like $27.50. You'll want to make that a variable which you can then update mySQL with. I do't know Regex, but from what I've read, its quite straightforward and logical. Quote Link to comment https://forums.phpfreaks.com/topic/83732-lifting-variable-info-from-a-webpage/#findComment-426027 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.