[Tutor] web scraping using Python and urlopen in Python 3.3

Walter Prins wprins at gmail.com
Wed Nov 7 17:25:50 CET 2012


Seema,

On 7 November 2012 15:44, Seema V Srivastava <seema.var at gmail.com> wrote:

> Hi,
> I am new to Python, trying to learn it by carrying out specific tasks.  I
> want to start with trying to scrap the contents of a web page.  I have
> downloaded Python 3.3 and BeautifulSoup 4.
>
> If I call upon urlopen in any form, such as below, I get the error as
> shown below the syntax:  Does urlopen not apply to Python 3.3?  If not then
> what;s the syntax I should be using?  Thanks so much.
>

See the documenation:
http://docs.python.org/2/library/urllib.html#utility-functions

Quote: "Also note that the
urllib.urlopen()<http://docs.python.org/2/library/urllib.html#urllib.urlopen>function
has been removed in Python 3 in favor of
urllib2.urlopen()<http://docs.python.org/2/library/urllib2.html#urllib2.urlopen>
."

Walter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20121107/de3f73d6/attachment.html>


More information about the Tutor mailing list