By dallas63 on
Hi guys,
Just a quick question :-)
I would like to scrape some of the data (not everything) from the table on this page: http://varde-sportsfiskerforening.dk/list_reports.php and display it in an other site - also in a table. How do i achieve this?
I don't have a clue about how to get started, and it would really mean a lot to get some help :-) Since the new site I'm making is for a nonprofit organization.
Thanks a lot.
Comments
_
This might be helpful - http://davidvielmetter.com/tricks/howto-convert-an-html-table-to-csv-usi...
Alternatively, you could view the page source and copy/paste the HTML table into a WYSIWYG editor and edit it there...
Thank you for quick reply. I
Thank you for quick reply.
I don't think the solutions are updating continuously - and that's what I need. Not a snapshot of the table right now, but a table that updates its content from the other table.
_
You might ask if they provide a feed of some type-- xml, rss, whatever. If they do, you can probably use the feeds module to import it. Even if not, you might be able to create a custom parser for feeds.
Otherwise, maybe you can use drupal_http_request.
simplehtmldom
I don't know if there is a better drupal solution, but you might want to check out http://simplehtmldom.sourceforge.net/ for the scraping part. I've used this a long time ago to scrape a table of baseball scores (this code is far from complete). You probably want to write your own module and also take care of some caching.
Sample module simplehtmldom
Here's the code for a small module called 'scraper' implementing simplehtmldom.