DOM樹中實際不存在僞元素(例如::before
或::after
)中的內容。所以,通過選擇器找到它是不可能的。網絡蜘蛛如何抓取::之前的內容?
問題是,我怎麼能提取它的內容?例如:
<div>This is <span></span>n apple.</div>
...
span::before {
content : "a"
}
shows : This is an apple.
但如果我提取div
的文字,我只會變得This is n apple.
沒有span::before
內容。
我該如何處理這個問題?
瀏覽器的做法是一樣的嗎? (通過解析和應用CSS ...) – nnnnnn
Dupe? http://stackoverflow.com/questions/16003916/is-css-content-property-seo-friendly –
@ Mr.Alien不,這是一個關於如何抓取包含僞元素的第三方網站的問題。 – Sraw