actuall the full error is this:
File "/home/felafela/BeautifulSoup.py", line 301, in __getitem__
return self._getAttrMap()[key]
KeyError: 'href'
--
http://mail.python.org/mailman/listinfo/python-list
hey ken thanks for writing. when i try that i get told
KeyError: 'href'
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> mike's code worked like a charm. i have one more question. i have an
> href which looks like this:
>
>
> http://www.cnn.com";>
>
>
> i thought i would use this code to get the href out but it fails, gives
> me a keyerror:
>
> for incident in row('td', {
mike's code worked like a charm. i have one more question. i have an
href which looks like this:
http://www.cnn.com";>
i thought i would use this code to get the href out but it fails, gives
me a keyerror:
for incident in row('td', {'class':'all'}):
n = incident.f
[EMAIL PROTECTED] writes:
> i need to scrape a url out of an href. it seems that people recommend
> that i use beautiful soup but had some problems.
What problem are you having with BeautifulSoup? It's working fine for
here.
> does anyone have sample code for scraping the actual url out of an hr
sorry paul-i'm an extremely beginner programmer, if that! ;-) can you
give me an example?
thanks in advance
Paul Rubin wrote:
> [EMAIL PROTECTED] writes:
> > does anyone have sample code for scraping the actual url out of an href
> > like this one
> >
> > http://www.cnn.com"; target="_blank">
>
>
[EMAIL PROTECTED] writes:
> does anyone have sample code for scraping the actual url out of an href
> like this one
>
> http://www.cnn.com"; target="_blank">
If you've got the tag by itself like that, just use a regexp to get
the href out.
--
http://mail.python.org/mailman/listinfo/python-list