SwiftSoup icon indicating copy to clipboard operation
SwiftSoup copied to clipboard

Get "#document" element

Open swifthing opened this issue 3 years ago • 1 comments

Hello,

Firstly thank you for this tool, swiftsoup is amazing

I have some question: how to get elements inside "#document" ?

Here in this link https://www.ultimedia.com/default/index/videogeneric/id/q0kxs3r

I want to get the url of the video, but it is inside a "iframe", and inside it there is "#document".

This is how I'm trying :

let doc = try? SwiftSoup.parse(contents)
let videoLink = doc.select("video#player-player_html5_api").attr("src")

But videoLink is empty ...

Can you help me ?

swifthing avatar Apr 15 '21 14:04 swifthing

try to print the result and see if there is an attribute src

scinfu avatar Dec 30 '21 13:12 scinfu