How can I scrape the current webpage with php/javascript?
Posted
by Robert
on Stack Overflow
See other posts from Stack Overflow
or by Robert
Published on 2010-05-15T15:37:57Z
Indexed on
2010/05/15
15:44 UTC
Read the original article
Hit count: 467
I have made the following webpage for generating interactive todo lists: http://robert-kent.com/todo/todo.php
Basically, the user pastes a numbered todo list and each task is placed into it's own div with a unique id. Users can add notes to the tasks (done with javascript) and can click the green check when the task is done to hide it.
I'd like to add an Export button which would generate a report of which tasks were completed and which were not, along with the user-entered notes. After a bit of searching I understand that what I want to do is scrape the page, but I haven't the faintest idea of the best way to do it. Many of the articles and tutorials I have found with Google involve scraping other sites and don't really explain how I could iterate over each div on the page.
Full source here: http://pastebin.com/r7V3P5jK
Any suggestions?
© Stack Overflow or respective owner