Jump to content

Simple-HTML-Dom - quick question


dmaco

Recommended Posts

I have a quick question to ask, as i cant see it in their docs. Maybe you can help me.

I am using http://simplehtmldom.sourceforge.net/

 

Right, i have written a Simple HTML Dom script to collect data from this page, as an example:

http://www.visualdesign.ie/_dev/myscraper/simplehtmldom/dev-env/scraping/daily/daily.html

 

Script executed by running a cron job on this file (which generates the XML):

http://www.visualdesign.ie/_dev/myscraper/simplehtmldom/dev-env/scraping/daily/daily.php

 

The data is collected, and written to this file in XML file:

http://www.visualdesign.ie/_dev/myscraper/simplehtmldom/dev-env/scraping/daily/daily.xml

 

Thats is fine, and the script essentially scrapes the entire page, with no conditional IF's for any sections.

 

A sample of my code for one segment is below:

http://pastebin.com/JLb8f92N 

 

What i would like to do now, and i am hoping you could help out is...

Scrap this same page, but produce seperate XML files, based on the date.

So if you view that page, i want to scrape the data in the table Saturday 4th February 2012 and produce XML for for that day only.

The i want to scrape the data in the section for Sunday 5th February 2012, and another for Tuesday 7th February 2012. I think its self explanatory.

 

The table date sections are separated by this HTML element: bg color = " #CCCCCC "

But bare in mind that the table rows on each date section will change when the site is updated, and there may be additional or less football game records.

 

Anyway, i would appreciate any help you can show me, on how to place in any conditionals in the code, and only scrape the date sections needed.

Separate script files would be fine if it was needed.

 

Many thanks for your time,

Darren.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.