检查 HTML

Python Web 爬取

Thomas Laetsch, PhD

Data Scientist, NYU

"Source" = HTML 代码

查看源代码

源代码

Python Web 爬取

检查元素

检查元素

元素源代码

Python Web 爬取

将 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 Web 爬取

你已经掌握诀窍了

Python Web 爬取

Preparing Video For Download...