FAQ
I need something to do xpath searches. I have been
using github.com/moovweb/gokogiri before, with excellent results, but it
doesn't work in Go 1.6.

     runtime error: cgo argument has Go pointer to Go pointer

Are there any alternatives? It doesn't look like gokogiri is maintained
anymore.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Andrey mirtchovski at Mar 2, 2016 at 7:01 pm
    I've been using https://github.com/treetopllc/xml successfully,
    although I'm only using it to verify signed XML files (the rest I
    parse in Go). It compiles with 1.6.
    On Wed, Mar 2, 2016 at 11:50 AM, Peter Kleiweg wrote:
    I need something to do xpath searches. I have been using
    github.com/moovweb/gokogiri before, with excellent results, but it doesn't
    work in Go 1.6.

    runtime error: cgo argument has Go pointer to Go pointer

    Are there any alternatives? It doesn't look like gokogiri is maintained
    anymore.

    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Peter Kleiweg at Mar 2, 2016 at 8:07 pm
    Op woensdag 2 maart 2016 20:01:20 UTC+1 schreef andrey mirtchovski:
    I've been using https://github.com/treetopllc/xml successfully,
    although I'm only using it to verify signed XML files (the rest I
    parse in Go). It compiles with 1.6.
    I can't get xpath to work with namespaces.
    And it doesn't return any errors, it just panics when something goes wrong.
    This won't do.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Peter Kieltyka at Mar 2, 2016 at 7:08 pm
    it's not exactly xpath, but have a look
    at https://github.com/PuerkitoBio/goquery
    On Wednesday, March 2, 2016 at 1:50:39 PM UTC-5, Peter Kleiweg wrote:

    I need something to do xpath searches. I have been using
    github.com/moovweb/gokogiri before, with excellent results, but it
    doesn't work in Go 1.6.

    runtime error: cgo argument has Go pointer to Go pointer

    Are there any alternatives? It doesn't look like gokogiri is maintained
    anymore.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Konstantin Khomoutov at Mar 2, 2016 at 7:51 pm

    On Wed, 2 Mar 2016 10:50:39 -0800 (PST) Peter Kleiweg wrote:

    I need something to do xpath searches. I have been
    using github.com/moovweb/gokogiri before, with excellent results, but
    it doesn't work in Go 1.6.

    runtime error: cgo argument has Go pointer to Go pointer

    Are there any alternatives? It doesn't look like gokogiri is
    maintained anymore.
    Its major downside is dependency on libxml2 which means cgo,
    and I'm pretty sure it's failing because of tightened rules of working
    with cgo in 1.6.

    In addition to what others have said, have a look at [1] and [2].

    1. https://github.com/beevik/etree
    2. https://godoc.org/gopkg.in/xmlpath.v2

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Peter Kleiweg at Mar 2, 2016 at 8:11 pm
    Op woensdag 2 maart 2016 20:51:26 UTC+1 schreef Konstantin Khomoutov:

    In addition to what others have said, have a look at [1] and [2].
    Both look promising. The first looks familiar because I worked with etree
    in Python in the past.
    The second doesn't look efficient if you want to do multiple xpath queries
    on a single document, because it parses the document using xpath. But it's
    much simpler than etree.

    Are there any benchmarks comparing these packages?

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Manlio Perillo at Mar 2, 2016 at 8:16 pm
    Il giorno mercoledì 2 marzo 2016 21:11:28 UTC+1, Peter Kleiweg ha scritto:
    Op woensdag 2 maart 2016 20:51:26 UTC+1 schreef Konstantin Khomoutov:

    In addition to what others have said, have a look at [1] and [2].
    Both look promising. The first looks familiar because I worked with etree
    in Python in the past.
    The second doesn't look efficient if you want to do multiple xpath queries
    on a single document, because it parses the document using xpath. But it's
    much simpler than etree.
    One problem I found with xmlpath.v2 is that, on a matched Node, all you can
    do is to call the Bytes and String methods.
    On the other hand, cascadia (CSS selector implementation) returns the
    html.Node, so you can get all the data you need.


    Manlio

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Sjon Kosse at Mar 2, 2016 at 10:02 pm
    You can turn off the new pointer rules for now, that'll resolve your
    current issue.
    On Wednesday, March 2, 2016 at 7:50:39 PM UTC+1, Peter Kleiweg wrote:

    I need something to do xpath searches. I have been using
    github.com/moovweb/gokogiri before, with excellent results, but it
    doesn't work in Go 1.6.

    runtime error: cgo argument has Go pointer to Go pointer

    Are there any alternatives? It doesn't look like gokogiri is maintained
    anymore.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Ingo Oeser at Mar 20, 2016 at 10:13 pm
    Hi,

    if someone still sees issues with gokogiri and Go 1.6,
    please try https://github.com/moovweb/gokogiri/pull/93 until it is merged
    by the repository owners.

    It works around the issues at the cost of a bit less concurrency (the
    callbacks into Go using Go pointers are now serialized).
    It is used in production already, to crawl large sites in order to extract
    text from them.

    Have fun,

    Ingo
    On Wednesday, March 2, 2016 at 7:50:39 PM UTC+1, Peter Kleiweg wrote:

    I need something to do xpath searches. I have been using
    github.com/moovweb/gokogiri before, with excellent results, but it
    doesn't work in Go 1.6.

    runtime error: cgo argument has Go pointer to Go pointer

    Are there any alternatives? It doesn't look like gokogiri is maintained
    anymore.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMar 2, '16 at 6:50p
activeMar 20, '16 at 10:13p
posts9
users7
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase