How is 618 sales champion made?Uncover the secret of e-commerce’s “invigorating” hundreds of millions of sales data>>>
Preface: in my graduation thesis, I plan to use Python as a crawler to crawl some data, and I started to learn Python recently
I encountered a problem in my study. I installed Python according to the article I read, configured the corresponding environment (using the window system), and used the pychar editor to write python (this software is very convenient to run python, and the library needed to install Python is also very simple)
After installing the two libraries of requests and beautifulsoup, we start to crawl a local HTML. At the beginning, we refer to from BS4 import beautifulsoup, but at the end, we always report importerror: no module named BS4 error
After checking some information, the problem was solved successfully
Solution:
The runtime prompts importerror: no module named BS4
error, which means that the module named beautifulsoup4 was not found
Write about how Python installs modules:
1. Download BS4 module:
http://www.crummy.com/software/BeautifulSoup/bs4/download/4.3/beautifulsoup4-4.3.2.tar.gz
2. Unzip to the root directory under the python installation directory:
3. Run CMD and enter the directory after decompression (if Python is installed on Disk C by default, after opening CMD, you can use CD… Statement to return to the root directory first, and then enter into python27/beautiful soup4-4.3.2)
4. Install BS4 module after entering python27/beautiful soup4-4.3.2
After installation, it can be used;