hi community,
what is needed to start with Python on OpenSuse 11.3?
lin
hi community,
what is needed to start with Python on OpenSuse 11.3?
lin
Hello dear folks - hello @ all.
i wanted to run the following code - but with no luck at all?
import urllib
import urlparse
import re
url = "http://search.cpan.org/author/?W"
html = urllib.urlopen(url).read()
for lk, capname, name in re.findall('<a href="(/~.*?/)"><b>(.*?)</b></a><br/><small>(.*?)</small>', html):
alk = urlparse.urljoin(url, lk)
data = { 'url':alk, 'name':name, 'cname':capname }
phtml = urllib.urlopen(alk).read()
memail = re.search('<a href="mailto:(.*?)">', phtml)
if memail:
data'email'] = memail.group(1)
print data
i get the following output:
suse-linux:/usr/perl # python parse_cpan_authors.py
Traceback (most recent call last):
File “parse_cpan_authors.py”, line 6, in <module>
html = urllib.urlopen(url).read()
File “/usr/lib/python2.6/urllib.py”, line 86, in urlopen
return opener.open(url)
File “/usr/lib/python2.6/urllib.py”, line 205, in open
return getattr(self, name)(url)
File “/usr/lib/python2.6/urllib.py”, line 467, in open_file
return self.open_local_file(url)
File “/usr/lib/python2.6/urllib.py”, line 481, in open_local_file
raise IOError(e.errno, e.strerror, e.filename)
IOError: [Errno 2] No such file or directory: ‘’
suse-linux:/usr/perl #
hmm - i look forward to hear from you
regards
dilbertone;-)
The script is working here without any Python-specific modifications to the system. Maybe you messed up something in your box… what did you do (before writing and running that script) ?