juz4eugene Posted October 30, 2011 Share Posted October 30, 2011 I need help on extracting of data from another website, commonly known as screen scrapping. I was able to do it with a basic created function, but it doesn't work for extracting data out from a table of another website. I want to extract the data from each row and data of this site http://online.wsj.com/mdc/public/page/2_3021-usetf.html, so that I can put these data into my database. My current code is <?php $data = file_get_contents('http://online.wsj.com/mdc/public/page/2_3021-usetf.html'); $regex = '/You(.+?) registered/'; preg_match($regex,$data,$match); var_dump($match); echo $match[1]; ?> Anyone has a script that I could modify to do that? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/250079-extracting-data-from-a-table-of-another-site/ Share on other sites More sharing options...
ManiacDan Posted October 30, 2011 Share Posted October 30, 2011 You've done...nothing here. What do you know about regex? You should be able to do this with relatively simple regular expressions. There aren't really any pre-made scripts for screen scraping. Also, it's probably illegal to scrape the Journal. Quote Link to comment https://forums.phpfreaks.com/topic/250079-extracting-data-from-a-table-of-another-site/#findComment-1283368 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.