Some <head> clauses cases BeautifulSoup to choke?

Chris Mellon arkanes at gmail.com
Mon Nov 19 14:54:13 EST 2007


On Nov 19, 2007 1:36 PM, Frank Stutzman <stutzman at skywagon.kjsl.com> wrote:
> I've got a simple script that looks like (watch the wrap):
> ---------------------------------------------------
> import BeautifulSoup,urllib
>
> ifile = urllib.urlopen("http://www.naco.faa.gov/digital_tpp_search.asp?fldId
> ent=klax&fld_ident_type=ICAO&ver=0711&bnSubmit=Complete+Search").read()
>
> soup=BeautifulSoup.BeautifulSoup(ifile)
> print soup.prettify()
> ----------------------------------------------------
>
> and all I get out of it is garbage.  Other simular urls from the same site
> work fine (use http://www.naco.faa.gov/digital_tpp_search.asp?fldId
> ent=klax&fld_ident_type=ICAO&ver=0711&bnSubmit=Complete+Search as one example).
>
> I did some poking and proding and it seems that there is something in the
> <head> clause that is causing the problem.  Heck if I can see what it is.
>
> I'm new to BeautifulSoup (heck, I'm new to python).  If I'm doing something
> dumb, you don't need to be gentle.
>

You have the same URL as both your good and bad example.



More information about the Python-list mailing list