On Wed, 20 Aug 2008 07:33:32 -0700 (PDT), Alexnb <alexnbryan@gma il.comwrote:
urllib.urlopen gives you a file-like object for a resource at an url.
file gives you a file-like object for a file on the local filesystem.
soup = BeautifulSoup(f ile('/the/name/of/the/file'))
Jean-Paul
>
>Okay, I have used BeautifulSoup a lot lately, but I am wondering, how do you
>open a local html file?
>
>Usually I do something like this for a url
>
>soup = BeautifulSoup(u rllib.urlopen(' http://www.website.com ')
>
>Okay, I have used BeautifulSoup a lot lately, but I am wondering, how do you
>open a local html file?
>
>Usually I do something like this for a url
>
>soup = BeautifulSoup(u rllib.urlopen(' http://www.website.com ')
>
file gives you a file-like object for a file on the local filesystem.
soup = BeautifulSoup(f ile('/the/name/of/the/file'))
Jean-Paul
Comment