Install Windows10 + Python3 + BeautifulSoup4 and windows10python3

Source: Internet
Author: User

Install Windows10 + Python3 + BeautifulSoup4 and windows10python3

It is quite troublesome to use regular expressions to extract content from webpages. Here we will introduce a Python library that can extract data from HTML or XML files: Beautiful Soup. it enables you to navigate, search, and modify documents by using your favorite converter. beautiful Soup helps you save hours or even days of work. beautiful Soup 4.2.0 documentation

The specific application has been clearly described in the official documentation, so I will not go into details here. Let's talk about the problems I encountered during installation.

 

1. Install python3
Download and install python3 and add the pathvariable, and rename the installed python.exeas python3.exe.

2. Install pip3
Input:> pip3
Problem: Fatal error in launcher: Unable to create process using '"'
Input:> python3-m pip install -- upgrade pip
Tip: Requirement already up-to-date: pip in c: \ users \ *** \ appdata \ local \ programs \ python \ python36-32 \ lib \ site-packages
Input:> python3-m pip install -- upgrade pip -- force-reinstall

Output:

Input:> pip3-V

Output: pip 9.0.1 from c: \ users \ *** \ appdata \ local \ programs \ python \ python36-32 \ lib \ site-packages (python 3.6)

Pip3 installed

3. Install BeautifulSoup4

> Pip3 install beautifulsoup4

If you want to use the source code to install BS4, download the source code of BS4 and install it through setup. py,

Decompress the downloaded package to your local computer and convert it to Python 3:

Go to \ Tools \ scripts under the Python installation directory, which contains 2to3. py, and use command Conversion

\ Python36-32 \ Tools \ scripts> python 2to3. py-w C: \ Users \ *** \ AppData \ Local \ Programs \ Python \ Python36-32 \ beautifulsoup4-4.6.0

Run the command prompt to enter the decompressed directory of BS4 and start the installation:

> Python setup. py install

4. Install the Parser:

> Pip3 install lxml

> Pip3 install html5lib

Installation is complete! You can start the test.

There are a large number of BeautifulSoup3 and Python2 code on the Internet. Various problems may occur during the demo test. We recommend that you refer to the official document when learning new content.

 

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.