This recipe shows how you can get perl to do the dirty work. You might also consider looking at the urllib module.
1 2 3 4 5 6 | import perl
perl.require("LWP::Simple")
get = perl.get_ref("LWP::Simple::get")
doc = get("http://www.python.org")
print doc
|
Tags: web
Isn't this the "Python" cookbook??? If I wanted to use Perl... Olivier Dagenais
What was the point? Was the point to demonstrate the perl module? Otherwise, it's easier to do this without the perl.
import urllib
uf = urllib.urlopen ('http://www.python.org')
doc = uf.read()
print doc
correct working code(py v3.0) for the same would be like this:
a correction uh = urllib.request.urlopen('http://python.org')