Quote:
Originally Posted by sark666
I'm trying to make my first recipe but I can't see why this isn't working:
It's from metronews, a Canadian daily news publication.
A url story would look like:
"http://www.metronews.ca/toronto/local/article/587467--finally-someone-at-the-acc-does-well"
But you can just have the 6 digit identifer. And the print equivalent would be:
"http://www.metronews.ca/ArticlePrint/587467?language=en"
But you only need the 6 digit identifer. At first I was adding the language bit, but when it wasn't working I removed it.
I tried it as str.split and string.split. Can't see where else it's wrong.
|
If you use string, you need to import it. You don't need it, however. Try:
split1 = url.split("/")
instead of
split1 = string.split(url,"/")
Also, check that your results are correct with a print, as in:
print 'split2 is: ', split2
right after you calc split2