Git Product home page Git Product logo

Comments (5)

TechnikEmpire avatar TechnikEmpire commented on July 20, 2024

IIRC, this is one of dozens of bugs. However, you might try getting rid of the space in your not-working example:

CSelection c = doc.find("div[class=' the-row']");

Should be:

CSelection c = doc.find("div[class='the-row']");

from gumbo-query.

TechnikEmpire avatar TechnikEmpire commented on July 20, 2024

On second thought you're not even doing a class selector correctly. See source here.

Class selector should be ".the-row". You're doing an attribute selector, which is requiring a full, complete match.

from gumbo-query.

RachidTagzen avatar RachidTagzen commented on July 20, 2024

@TechnikEmpire
That's working now.
Oddly, I have tried the correct Selector way in the past without a good results, and it works now. I don't know why!!

I have an other question: it is possible to match 2 or more conditions with 'find'?
e.g: finding the nodes with: class="the-row" And/Or href="http://www.exampe.com"

Thank you.

from gumbo-query.

TechnikEmpire avatar TechnikEmpire commented on July 20, 2024

You should be able to run basically any css3 selector. Google how to compose such selectors and they should work. I rewrote this library quite a while ago and there are a lot of bugs that cause certain selectors and other things to fail, but I can't remember them all. So you may find that perfectly valid selectors fail or give improper results. If your code is remotely critical, write some tests to verify it because I'd bet my bottom dollar they're not all going to work correctly. It's not the author of this port's fault either, a great many of the bugs were ported over from cascadia, the original source.

from gumbo-query.

RachidTagzen avatar RachidTagzen commented on July 20, 2024

Thank you for explanation.

from gumbo-query.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.