「檢視 HTML」

Python 網頁爬蟲

Thomas Laetsch, PhD

Data Scientist, NYU

「Source」= HTML 程式碼

檢視原始碼頁面

原始碼視窗

Python 網頁爬蟲

檢查元素

檢查元素頁面

元素對應原始碼

Python 網頁爬蟲

HTML 文字轉為 Selector

from scrapy import Selector
import requests

url = 'https://en.wikipedia.org/wiki/Web_scraping'
html = requests.get( url ).content
sel = Selector( text = html )
Python 網頁爬蟲

你已掌握祕訣

Python 網頁爬蟲

Preparing Video For Download...