Python Network data Acquisition code update

Source: Internet
Author: User
Tags virtual environment

A lot of this code will appear in the Python Network data acquisition book:

1  from Import Urlopen 2  from Import BeautifulSoup 3 html = urlopen (URL)4 bsobj = BeautifulSoup (HTML)

I also followed the entry of this section of code, but the prompt appears:

Userwarning:no parser was explicitly specified, so I ' m using the best available HTML parser for this system ("Html.parser "). This usually isn ' t a problem, but if you run the this code on another system, or in a different virtual environment, it may us e a different parser and behave differently.

The code that caused this warning are on line 1 of the file <string>. To get rid of the This warning, the change code is looks like this:

BeautifulSoup (Your_markup})

To this:

BeautifulSoup (Your_markup, "Html.parser")

According to the prompt, this will be bsobj = BeautifulSoup (HTML), instead of bsobj = BeautifulSoup (HTML, "Html.parser") on the line.

Python Network data Acquisition code update

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.