On May 19, 4:01 pm, Paul McGuire <[EMAIL PROTECTED]> wrote:
> On May 19, 4:54 am, [EMAIL PROTECTED] wrote:
>
>
>
> > Hello,
>
> > ***
> > import urllib2
> > import re
> > import string
> > import sys
>
> > url = "http://www.macgyver.com/";
> > request = urllib2.Request(url)
> > opener =
On May 19, 8:09 am, Paul McGuire <[EMAIL PROTECTED]> wrote:
> On May 19, 4:54 am, [EMAIL PROTECTED] wrote:> Hello,
>
>
>
>
>
> > print out
> > **
>
> Since you have no control over spacing and line breaks in the input,
> you can reformat using the textwrap module. First replace all "\
On May 19, 4:54 am, [EMAIL PROTECTED] wrote:
> Hello,
>
>
> print out
> **
Since you have no control over spacing and line breaks in the input,
you can reformat using the textwrap module. First replace all "\n"s
with " ", then use re.sub to replace multiple spaces with a single
space
On May 19, 4:54 am, [EMAIL PROTECTED] wrote:
> Hello,
>
> ***
> import urllib2
> import re
> import string
> import sys
>
> url = "http://www.macgyver.com/";
> request = urllib2.Request(url)
> opener = urllib2.build_opener()
> html = opener.open(request).read()
>
> match = re.compile("(
[EMAIL PROTECTED] wrote:
> Hello,
>
> ***
> import urllib2
> import re
> import string
> import sys
>
> url = "http://www.macgyver.com/";
> request = urllib2.Request(url)
> opener = urllib2.build_opener()
> html = opener.open(request).read()
>
> match = re.compile("(.+)", re.DOTALL)
Hello,
***
import urllib2
import re
import string
import sys
url = "http://www.macgyver.com/";
request = urllib2.Request(url)
opener = urllib2.build_opener()
html = opener.open(request).read()
match = re.compile("(.+)", re.DOTALL)
out = match.findall(html)
print out
**