Can you think of a way to scrape content from this page?

Status
Not open for further replies.

CLKeenan

Banned
Jun 24, 2006
2,506
14
0
Boston, MA
Alright, so I'm moving from Joomla to Drupal and I need to move over all of my articles. However, because of the way I setup the content in Joomla, its not very easy to just download the mysql database, make a few changes, and then import it to the drupal site.

Can anyone think of a way to scrape the name of the quiz, the question, the answers, and the right answer in a standardized way across all of the quizzes?

Here is an example of one of the quizzes:

Course-Notes.Org - Early Discovery and Settlement - Quiz 3

You can tell which answer is the right answer by looking at the CheckAnswer function seen here:
Code:
<tr>
      <td></td>
      <td VALIGN="TOP"><input TYPE="text" VALUE=" " size="3" NAME="Q1D"></td>
      <td VALIGN="TOP"><input TYPE="button" VALUE="   D   " OnClick="CheckAnswer(X, Y, Z)"></td>

      <td VALIGN="TOP">the Church of England had become so corrupt that all true Christians were
      obligated to separate from it.</td>
    </tr>

X = the question number
Y = the answer number
Z = determines if the answer is right or wrong (0 = wrong, 1 = right)

Ultimately, I'd like it to scrape those fields and enter it into format that I designate (haven't figured that part out yet... need to look at the database structure for that).

With that said, do you think its possible? Cause otherwise I have 111 quizzes of 10 questions each to enter one at a time....... kill me.
 


Just use something like BeautifulSoup for python to scrape the fucker and then process it.

Beautiful Soup

It shouldn't be too hard, but it would probably be much easier to grok the database.

This should be easy for a programmer that has any skill.
 
Status
Not open for further replies.