[Tutor] Extracting data from HTML files

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Sat Dec 31 05:06:18 CET 2005


> > >>>>category = m.group(1)
> > >
> > > Traceback (most recent call last):
> > >   File "<stdin>", line 1, in ?
> > > AttributeError: 'NoneType' object has no attribute 'group'
> >
> > In this case the match failed, so m is None and m.group(1) gives an
> >error.
>
> So my problem is in the actual regex? I`ve been trying to match other
> pieces of data with no luck. I`ll double check the formatting in the
> HTML to see if that is the problem.

Yeah, the regular expression must be fully satisfied, or it won't match at
all.

It's very discriminating; since you're learning about programming, you
already are getting to know that computers are very discriminating and
stupid.  *grin*



More information about the Tutor mailing list