日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 默认站点!

默认站点

當前位置: 首頁 >

Windows下Python 3.6 安装BeautifulSoup库

發(fā)布時間:2023/11/27 30 豆豆
默认站点 收集整理的這篇文章主要介紹了 Windows下Python 3.6 安装BeautifulSoup库 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

?介紹Python庫BeautifulSoup安裝。




01




BeautifulSoup庫介紹



Beautiful Soup是Python的一個庫,支持Python 2和Python 3,最主要的功能是從網頁抓取數(shù)據(jù),即爬蟲,官網介紹如下:


  1. Beautiful Soup provides a few simple methods and Pythonic idioms for navigating, searching, and modifying a parse tree: a toolkit for dissecting a document and extracting what you need. It doesn't take much code to write an application

  2. Beautiful Soup automatically converts incoming documents to Unicode and outgoing documents to UTF-8. You don't have to think about encodings, unless the document doesn't specify an encoding and Beautiful Soup can't detect one. Then you just have to specify the original encoding.

  3. Beautiful Soup sits on top of popular Python parsers like?lxml?and?html5lib, allowing you to try out different parsing strategies or trade speed for flexibility.


翻譯過來就是:


  1. Beautiful Soup提供一些簡單易用的方法來處理導航、搜索、修改網頁解析樹等功能。它是一個工具集合,通過解析文檔方便用戶提取所需數(shù)據(jù),可用很少代碼就寫出一個完整的程序。

  2. Beautiful Soup自動將輸入文檔轉換為Unicode,輸出文檔轉換為UTF-8,從而使用戶不需要考慮文檔的編碼方式,除非文檔沒有指定編碼,此時則需用戶說明文檔編碼方式。

  3. Beautiful Soup已成為和lxml、html5lib等相當?shù)腜ython解釋器,豐富了用戶的解析策略和開發(fā)的靈活性。.

?Beautiful Soup官網為:https://www.crummy.com/software/BeautifulSoup/



02


下載安裝


安裝方法如下:


  1. Beautiful Soup官網下載Beautiful Soup庫,目前版本為4.6.0。

  2. 解壓縮,假設放到C:/python36/下。

  3. 運行cmd,切換到Beautiful Soup目錄下。

  4. 運行命令:

    setup.py build

    setup.py install

  5. 在IDE下from bs4 import BeautifulSoup,沒有報錯說明安裝成功。



02



PIP安裝


如果上一種方法安裝不成功,可以用第二種方法,記住,Python3.6下是pip3。

安裝方法如下:


  1. ?pip3 install beautifulsoup4。


  2. 在IDE下from bs4 import BeautifulSoup,沒有報錯說明安裝成功。



掃我關注,及時獲取技術分享。






總結

以上是默认站点為你收集整理的Windows下Python 3.6 安装BeautifulSoup库的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得默认站点網站內容還不錯,歡迎將默认站点推薦給好友。

歡迎分享!

轉載請說明來源于"默认站点",并保留原作者的名字。

本文地址:Windows下Python 3.6 安装Beautiful