scinfu / SwiftSoup

SwiftSoup: Pure Swift HTML Parser, with best of DOM, CSS, and jquery (Supports Linux, iOS, Mac, tvOS, watchOS)
https://scinfu.github.io/SwiftSoup/
MIT License
4.53k stars 345 forks source link

a confuse problem, seem without consider web render #80

Closed icoco closed 6 years ago

icoco commented 6 years ago

http://36kr.com/p/5133686.html

the page article text content was embed in javascript, the text can not retrieve , eg:

let html = try String.init(contentsOf: url) document = try SwiftSoup.parse(html) ,

then the document.text can not got the article text totally, only some text.

I try other way, load the url via UIWebView,then got the html content ( accurately, call javascript "document.documentElement.outerHTML" from native app ), then parse the html text, it can got full article content, but other problem occurs, the method let images: Elements = try self.select("img[src$=.png]")

the select method seem not works properly, but as previous way, the method can got images correctly.