Skip to content

Unable to get cssSelector for node with escape character #222

Open
@siuying

Description

When there were non alphanumeric characters in css classes, cssSelector() will failed with error like "Could not parse query div.Fz(xs).Fw(b): unexpected token at (xs).Fw(b)"

Sample:

let html: String = #"<div class="Fz(xs) Fw(b)"><div>149.64</div></div>"#
let doc = try SwiftSoup.parse(html)
let element = try doc.getElementsContainingOwnText("149.64")
try element.first()?.cssSelector()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions