GithubHelp home page GithubHelp logo

import pup in code about pup HOT 4 CLOSED

ericchiang avatar ericchiang commented on August 13, 2024
import pup in code

from pup.

Comments (4)

ericchiang avatar ericchiang commented on August 13, 2024

Hi @jgranduel! Questions like this are better suited for Go general forms than developer issues.

You can't import a main package in Go, so you won't be able to import pup.

However pup just uses the golang.org/x/net/html package for parsing HTML. You can easily use that to do all of your HTML parsing.

Here's a program which does what you're describing: https://gist.github.com/ericchiang/4cbefb674c9a4c0b33c2

If you need help understanding the program I posted, please ask for help on the golang-nuts form or the IRC channel (see the link at the top of this comment). They're really nice and that's what they're there for!

from pup.

jgranduel avatar jgranduel commented on August 13, 2024

Thank you very much for you answer and the useful Gist.
My question was mainly about using Pup as a library for the ease of use the CSS Selectors. But it'll remain a program. So I'll stick with (and learn) golang.org/x/net/html as you showed in your gist.

Thanks again.

from pup.

ericchiang avatar ericchiang commented on August 13, 2024

My question was mainly about using Pup as a library for the ease of use the CSS Selectors.

see https://github.com/ericchiang/css for experimental support for this

from pup.

john-bonachon avatar john-bonachon commented on August 13, 2024

Is there any example rendering JSON (using your JSONDisplayer{}) instead of HTML?

from pup.

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.