Thanks for the time you've spent anyway Peter. I have superkaramba installed and the rest of the script is running fine, it's only when I put the urlopen part in that it comes back with errors. The quotes are just to make it readable on here as my first attempt at posting muted the text.