--- title: 19.Python 網路爬蟲 Web Crawler 基本教學 By 彭彭 tags: 學習, 紀錄 --- # 19.Python 網路爬蟲 Web Crawler 基本教學 By 彭彭 {%youtube 9Z9xKWfNo7k %} ## 基本流程 1. 連線到特定網址,抓取資料 2. 解析資料,取得實際想要的部分 ### ㄧ、抓取資料 關鍵心法:盡可能地,讓程式模仿一個普通使用者的樣子 ### 解析資料 - Json 格式資料:使用內建的json模組即可 - HTML格式資料(以標籤為單位):使用第三方套件BeautifulSoup來做解析: 1.安裝套件:PIP套件管理工具:安裝python時,就一起安裝在你的電腦裡了 2.利用PIP套件管理工具來安裝Beautiful Soup:pip install beautifulsoup4 - -- chrome> 更多工具>開發人員工具>重新整理>Network>下方index.html>request headers>複製user-agent ## END
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up