profile
viewpoint

dgryski/dgoogauth 346

Google Authenticator for Go

mna/agora 323

a dynamically typed, garbage collected, embeddable programming language built with Go

mattetti/goRailsYourself 84

A suite of random functions needed when porting/mixing Go/Rails code. Use at your own risk, don't expect much and feel free to send lots of awesome pull requests.

mna/advice 41

Advice functional mixin based on Twitter's Angus Croll presentation (How we learned to stop worrying and love Javascript).

mna/angular-gtd 6

An example app for Getting Things Done built with AngularJS.

mna/assnat 4

Extracteur des données du site de l'Assemblée Nationale du Québec, pour nourrir assnatapi.

mna/assnatapi 4

API pour exploiter les données de l'Assemblée nationale du Québec.

mna/boom 4

HTTP(S) load generator, ApacheBench (ab) replacement, written in Go

mna/amber 2

Amber is an elegant templating engine for Go Programming Language, inspired from HAML and Jade

mattetti/bugsnag-go 1

bugsnag.com API client in Go

issue commentPuerkitoBio/goquery

Is it possible to get text after html tag?

Oh you don't have to, if all you have is the three spans, when parsed with the net/html parser, it will automatically add the html/head/body tags to make it a proper document (the Go html parser uses the same logic as the official html5 parser unsed in browsers, so it tries hard to "fix" documents to make them valid). When in doubt, you should print the full html document after the call to goquery.NewDocument... (using goquery.OuterHtml(doc.Selection)).

sooxt98

comment created time in 4 days

issue commentPuerkitoBio/goquery

Is it possible to get text after html tag?

Just change the "div" selector (which obviously won't work) with "body".

sooxt98

comment created time in 4 days

issue commentPuerkitoBio/goquery

Is it possible to get text after html tag?

What do you mean? Did you try the example in the issue I linked?

const data = `
<div>
<span></span>1
<span></span>2
<span></span>3
</div>
`

func main() {
	doc, err := goquery.NewDocumentFromReader(strings.NewReader(data))
	if err != nil {
		log.Fatal(err)
	}
	doc.Find("div").Contents().Each(func(i int, s *goquery.Selection) {
		if goquery.NodeName(s) == "#text" {
			fmt.Printf(">>> (%d) >>> %s\n", i, s.Text())
		}
	})
}

// Prints:
// >>> (0) >>> 
// >>> (2) >>> 1
// >>> (4) >>> 2
// >>> (6) >>> 3
sooxt98

comment created time in 4 days

issue commentPuerkitoBio/goquery

fail to find id with $ sign

If you're stuck dealing with this, you can always use the attribute selector, as if id was just any other attribute:

doc.Find("[id='blah$0']")

Not sure of the performance of that, but at least you can get to that element.

sooxt98

comment created time in 4 days

issue commentPuerkitoBio/goquery

Is it possible to get text after html tag?

Not directly with a selector, but see https://github.com/PuerkitoBio/goquery/issues/287 .

sooxt98

comment created time in 4 days

issue closedPuerkitoBio/goquery

fail to find id with $ sign

<span id="blah$0">1</span>

Find('#blah$0') not working as expected, it just return empty

closed time in 4 days

sooxt98

issue commentPuerkitoBio/goquery

fail to find id with $ sign

The dollar sign is not a valid id character: https://stackoverflow.com/questions/448981/which-characters-are-valid-in-css-class-names-selectors

sooxt98

comment created time in 4 days

issue commentPuerkitoBio/goquery

No way to get first decendents

This is correct, as <a>1</a> is also directly under a p that is directly under a div. If you had for example this html:

<div>
    <h1>
        <p><a>1</a></p>
    </h1>
    <p><a>2</a></p>
    <p><a>3</a></p>
</div>

Then it would return only 2 and 3.

Martin

sooxt98

comment created time in 5 days

issue closedPuerkitoBio/goquery

Inconsistent results using doc.find()

For some reason doc.find() is able to detect an element but after trying consecutive tries it doesn't work 99% of the time

closed time in 8 days

Neguhs

push eventmna/xpgsql

Martin Angers

commit sha f431d8afe98b64178a4b083cc383787eb482f984

v0.4 rockspec

view details

push time in 12 days

created tagmna/xpgsql

tagv0.4

Lua module providing a straightforward API to the luapgsql library. (mirror)

created time in 12 days

push eventmna/xpgsql

Martin Angers

commit sha b5e1e99472392e9bf66cac1228782fb6d1927835

Add Connection:ensuretx and Connection:with

view details

push time in 12 days

PR closed PuerkitoBio/urlesc

Add poweron architecture ppc64le to travis build

This is part of the Ubuntu distribution for ppc64le. This helps us simplify testing later when distributions are re-building and re-releasing, For more info please tag @gerrith3.

+8 -1

3 comments

1 changed file

asellappen

pr closed time in 13 days

pull request commentPuerkitoBio/urlesc

Add poweron architecture ppc64le to travis build

Ok, thanks for the update.

asellappen

comment created time in 13 days

push eventmna/xpgsql

Martin Angers

commit sha 8152ebefe3559ed8a71c89fe4957ce765364a84c

Update doc

view details

push time in 13 days

push eventmna/xpgsql

Martin Angers

commit sha f8078249a24e3f7a86165769e32a7b07b5105ed0

Set Connection.transaction to true inside tx

view details

Martin Angers

commit sha 647cb4aeec9b1a9d6ba51ce63584363906e1b97d

Add v0.3

view details

push time in 13 days

created tagmna/xpgsql

tagv0.3

Lua module providing a straightforward API to the luapgsql library. (mirror)

created time in 13 days

pull request commentPuerkitoBio/urlesc

Add poweron architecture ppc64le to travis build

Hello,

This repo is pretty much unmaintained and I'm not even sure it is needed anymore, with recent versions of Go. I'm a bit hesitant to add testing targets that are not relevant to this repo - any blockers for you to use a recent Go version directly instead of this repo, or use your own fork instead of adding your specific testing needs here? I would rather archive this repo, actually.

Martin

asellappen

comment created time in 13 days

startedakkartik/mu

started time in 15 days

issue commentPuerkitoBio/goquery

Inconsistent results using doc.find()

Hello,

Can you please provide a minimal, runnable example (with the html data) to reproduce the issue, with logs of what it prints when it doesn't work?

Thanks, Martin

Neguhs

comment created time in 15 days

startedcharmbracelet/bubbletea

started time in 17 days

created tagPuerkitoBio/goquery

tagv1.6.0

A little like that j-thing, only in Go.

created time in 20 days

release PuerkitoBio/goquery

v1.6.0

released time in 20 days

push eventPuerkitoBio/goquery

Martin Angers

commit sha b3706f8903171e91b2ad8cdb1e59eb2be67c010b

update readme to prepare for new release

view details

push time in 20 days

PR closed PuerkitoBio/goquery

Fixes #178 - Send context to parseHtml

This creates a new function parseHtmlWithContext, which behaves just like parseHtml but takes an *html.Node as context.

It also create a function eachNodeHtml which will iterate over each node in a selection, check to see if we have parsed html for this node type already, and if not, will call parseHtmlWithContext with either the current node, or it's parent, depending on whether you passed parent as true or false.

It also changes AfterHtml, AppendHtml, BeforeHtml, PrependHtml, ReplaceWithHtml, SetHtml, WrapHtml, WrapAllHtml, and WrapInnerHtml to use one or both of these functions.

New tests were added for all except the WrapHtml* functions - changing these functions may have been unncessary - I couldn't think of a way to test this - Go automatically wraps tr elements in tbody, so I can't wrap those, and I can't think of any other situation that this would occur in.

+174 -18

3 comments

3 changed files

davidjwilkins

pr closed time in 20 days

pull request commentPuerkitoBio/goquery

Fixes #178 - Send context to parseHtml

Superceded by #348 .

davidjwilkins

comment created time in 20 days

push eventPuerkitoBio/goquery

David Wilkins

commit sha 99c8f1ecd57161e11c7b0e9d28db021296753fbf

Fixes #178 - Send context to parseHtml

view details

thiemok

commit sha d89086ead1a84b8176c983497d9add8a97759685

fix(manipulation): address issues from code review of #235 * SetHml remains unchanged, see comment on the isParent param of eachNodeHtml * Removed unused functions * Added documentation on eachNodeHtml * Fixed node parsing cache keys and added test * Refactored some tests for clarity

view details

Martin Angers

commit sha 5d7b0271f0444fb5ee2c1385f857c659c098038f

add tests to confirm erroneous behaviour

view details

thiemok

commit sha 94c2530dd898fac51c676ea4a9f915ccaa00c2c8

fix(manipulation): fix node insertion and caching issues Node caching was still using the node type instead of the node name in a few places. Updated those to also use the node name as the cache key. ReplaceWithHtml and PrependHtml inserted parsed nodes in the wrong order. Kept track of the correct parent to fix this. Use correct parent flag for SetHtml

view details

Martin Angers

commit sha 4a687a672f0f3b30ea3a60775067215da81d8081

add test cases to check html insertion order

view details

Martin Angers

commit sha 7ebd145bd7b75771461b557dc2e53525191d3dd3

Merge pull request #348 from thiemok/context Send context to parseHtml. Closes #178 .

view details

push time in 20 days

issue closedPuerkitoBio/goquery

Append method ignores td th

If I try to Append("<th>New</th>"), the 'th' tag is always dropped. Same for td, tr

closed time in 20 days

awsong

PR merged PuerkitoBio/goquery

Send context to parseHtml

I stumbled upon the open bug in #178 and the open pull request to fix it in #235. The original pull request seems to have been abandoned by its original creator, however I would like to have the original bug fixed.

This pr is a fork of the original one by @davidjwilkins and I have tried to address all the issues from the initial code review.

This is my first contribution to a go library so please let me know if I violated any conventions. Let me know if you need any changes, or further documentation.

Original pr message for context:

This creates a new function parseHtmlWithContext, which behaves just like parseHtml but takes an *html.Node as context.

It also create a function eachNodeHtml which will iterate over each node in a selection, check to see if we have parsed html for this node type already, and if not, will call parseHtmlWithContext with either the current node, or it's parent, depending on whether you passed parent as true or false.

It also changes AfterHtml, AppendHtml, BeforeHtml, PrependHtml, ReplaceWithHtml, SetHtml, WrapHtml, WrapAllHtml, and WrapInnerHtml to use one or both of these functions.

New tests were added for all except the WrapHtml* functions - changing these functions may have been unncessary - I couldn't think of a way to test this - Go automatically wraps tr elements in tbody, so I can't wrap those, and I can't think of any other situation that this would occur in.
+324 -31

7 comments

4 changed files

thiemok

pr closed time in 20 days

pull request commentPuerkitoBio/goquery

Send context to parseHtml

I added some test cases as the AfterHtml also had the ordering issue (I fixed it in my commit). The rest looks good to me, thanks a lot for your work! Note that I inadvertently pushed my commit to a new branch on your fork at first, I didn't realize my branch name was different than the PR's, you can ignore this.

I'll get this merged and cut a new release.

thiemok

comment created time in 20 days

push eventthiemok/goquery

Martin Angers

commit sha 4a687a672f0f3b30ea3a60775067215da81d8081

add test cases to check html insertion order

view details

push time in 20 days

create barnchthiemok/goquery

branch : thiemok-context

created branch time in 20 days

pull request commentPuerkitoBio/goquery

Send context to parseHtml

Awesome, thanks!

On Wed, Oct 7, 2020 at 11:26 AM Thiemo notifications@github.com wrote:

I have done both and will clean up the rest later today.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PuerkitoBio/goquery/pull/348#issuecomment-705012520, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFJBIGR42IQ23A6OJCAJCTSJSCCDANCNFSM4R4REBHA .

thiemok

comment created time in 20 days

pull request commentPuerkitoBio/goquery

Send context to parseHtml

I can't push to the PR as it is from your fork and branch, so I pushed the changes I made to some tests and the helper loadString in the thiemok-context branch (https://github.com/PuerkitoBio/goquery/tree/thiemok-context). You can update your PR from it, or I believe you can give me push permissions to your fork following those instructions, as you wish: https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork

thiemok

comment created time in 20 days

create barnchPuerkitoBio/goquery

branch : thiemok-context

created branch time in 20 days

Pull request review commentPuerkitoBio/goquery

Send context to parseHtml

 func (s *Selection) WrapInnerSelection(sel *Selection) *Selection { // cloned before being inserted into the document. // // It returns the original set of elements.-func (s *Selection) WrapInnerHtml(html string) *Selection {-	return s.wrapInnerNodes(parseHtml(html)...)+func (s *Selection) WrapInnerHtml(htmlStr string) *Selection {+	nodesMap := make(map[html.NodeType][]*html.Node)+	for _, context := range s.Nodes {+		nodes, found := nodesMap[context.Type]

Same here, the key should be the node name.

thiemok

comment created time in 21 days

Pull request review commentPuerkitoBio/goquery

Send context to parseHtml

 func (s *Selection) ReplaceWithSelection(sel *Selection) *Selection { // It returns the removed elements. // // This follows the same rules as Selection.Append.-func (s *Selection) ReplaceWithHtml(html string) *Selection {-	return s.ReplaceWithNodes(parseHtml(html)...)+func (s *Selection) ReplaceWithHtml(htmlStr string) *Selection {+	s.eachNodeHtml(htmlStr, true, func(node *html.Node, nodes []*html.Node) {+		for _, n := range nodes {+			if node.Parent != nil {+				node.Parent.InsertBefore(n, node.NextSibling)

Same here, I believe the order needs to be reversed to keep the original order of the html string intact.

thiemok

comment created time in 20 days

Pull request review commentPuerkitoBio/goquery

Send context to parseHtml

 func (s *Selection) ReplaceWithNodes(ns ...*html.Node) *Selection {  // SetHtml sets the html content of each element in the selection to // specified html string.-func (s *Selection) SetHtml(html string) *Selection {-	return setHtmlNodes(s, parseHtml(html)...)+func (s *Selection) SetHtml(htmlStr string) *Selection {+	for _, context := range s.Nodes {+		for c := context.FirstChild; c != nil; c = context.FirstChild {+			context.RemoveChild(c)+		}+	}+	return s.eachNodeHtml(htmlStr, true, func(node *html.Node, nodes []*html.Node) {

Here I believe the isParent flag should be false, the node itself is the context for the html, not its parent. I'll also add a test to confirm this.

thiemok

comment created time in 21 days

Pull request review commentPuerkitoBio/goquery

Send context to parseHtml

 func (s *Selection) PrependSelection(sel *Selection) *Selection { }  // PrependHtml parses the html and prepends it to the set of matched elements.-func (s *Selection) PrependHtml(html string) *Selection {-	return s.PrependNodes(parseHtml(html)...)+func (s *Selection) PrependHtml(htmlStr string) *Selection {+	return s.eachNodeHtml(htmlStr, false, func(node *html.Node, nodes []*html.Node) {+		for _, n := range nodes {+			node.InsertBefore(n, node.FirstChild)

The order of the nodes to prepend would need to be reversed, otherwise this would insert the last node in nodes as first. I'll add a test to confirm what I think would happen.

thiemok

comment created time in 21 days

Pull request review commentPuerkitoBio/goquery

Send context to parseHtml

 func (s *Selection) WrapSelection(sel *Selection) *Selection { // most child of the given HTML. // // It returns the original set of elements.-func (s *Selection) WrapHtml(html string) *Selection {-	return s.wrapNodes(parseHtml(html)...)+func (s *Selection) WrapHtml(htmlStr string) *Selection {+	nodesMap := make(map[html.NodeType][]*html.Node)+	var parent *html.Node+	for _, context := range s.Nodes {+		if context.Parent != nil {+			parent = context.Parent+		} else {+			parent = &html.Node{Type: html.ElementNode}+		}+		nodes, found := nodesMap[parent.Type]

The map (cache) should use the node name logic as in eachNodeHtml as key, not the Type.

thiemok

comment created time in 21 days

Pull request review commentPuerkitoBio/goquery

Send context to parseHtml

 func loadDoc(page string) *Document { 	return NewDocumentFromNode(node) } +func loadString(doc string, t *testing.T) *Document {

Let's have t as first argument, for consistency with other test helpers (I'll push a commit with that change, no worries).

thiemok

comment created time in 21 days

PullRequestReviewEvent
PullRequestReviewEvent

issue closedPuerkitoBio/goquery

why get null html

package main

import (
	"fmt"
	"github.com/PuerkitoBio/goquery"
	"github.com/gin-gonic/gin"
	"net/http"
	"strings"
)

func main() {

	router := gin.Default()
	// Set a lower memory limit for multipart forms (default is 32 MiB)
	router.MaxMultipartMemory = 8 << 20 // 8 MiB
	router.GET("/", func(c *gin.Context) {
		doc, _ := goquery.NewDocumentFromReader(strings.NewReader("<input value=\"hello world\"/>"))
		doc.Find("*").Each(func(i int, se *goquery.Selection) {
			if se.Nodes[0].Data == "input" {
				html, _  := goquery.OuterHtml(se)
				fmt.Println(html)

				se.SetHtml("<input value=\"world hello\"/>")
			}
		})

		html, _ := doc.Html()
		c.Writer.WriteHeader(http.StatusOK)
		//Convert your cached html string to byte array
		c.Writer.Write([]byte(html))
		return

	})
	router.Run(":80")
}

closed time in a month

AiPacino

created tagmna/xpgsql

tagv0.2

Lua module providing a straightforward API to the luapgsql library. (mirror)

created time in a month

push eventmna/xpgsql

Martin Angers

commit sha aed6ad1cfcb1b71b82ac4d179197ef39d1b4c15b

actually support cqueues-pgsql

view details

Martin Angers

commit sha bf596e937509b7e11ec153b9e48914c404eca865

add 0.2 rockspec

view details

push time in a month

pull request commentPuerkitoBio/goquery

Send context to parseHtml

Hey, thanks for doing this!

Just wanted to let you know I have taken a quick look, it seems pretty good but I don't have time to do a thorough review to land this just yet - I'll do my best to get this done ASAP, hopefully before next week.

Thanks, Martin

thiemok

comment created time in a month

issue commentPuerkitoBio/goquery

":contains" selector sometimes returns all parents instead of one

Oh, looks like :containsOwn is not even a jQuery selector, but a jsoup one, that somehow cascadia (the selector package used by goquery) decided to support. See https://jsoup.org/apidocs/org/jsoup/select/Selector.html

But yeah, from what I read, it seems like :contains behaves as expected.

juliensalinas

comment created time in a month

issue commentPuerkitoBio/goquery

":contains" selector sometimes returns all parents instead of one

Salut Julien,

I'm not super familiar with :contains, but shouldn't that be containsOwn? I.e. the following (slightly modified) code does what you want:

func main() {
	const html = "<html><body><div>Julien, Developer</div><div>Martin, Developer</div></body></html>"
	doc, err := goquery.NewDocumentFromReader(strings.NewReader(html))
	if err != nil {
		log.Fatal(err)
	}
	doc.Find(":containsOwn('Developer')").Each(func(i int, s *goquery.Selection) {
		fmt.Println(i, goquery.NodeName(s), s.Text())
	})
}

// prints 
// 0 div Julien, Developer
// 1 div Martin, Developer

I think :contains returns all nodes that contain that text, so every node does?

Hope this helps, Martin

juliensalinas

comment created time in a month

issue commentPuerkitoBio/goquery

goquery Find method not compatibe with jQuery

Hello,

it seems goQuery is good at finding only simple css selector. Not nested selector like a > b.ins.pro > c or anything complex.

Sure it does:

const data = `
<html>
  <head>
  </head>
  <body>
    <div>
      <p class="ins">
        <span>A</span>
      </p>
      <p class="pro">
        <span>B</span>
      </p>
      <p class="ins pro">
        <span>C</span>
      </p>
    </div>
  </body>
</html>
`

func main() {
	doc, err := goquery.NewDocumentFromReader(strings.NewReader(data))
	if err != nil {
		log.Fatal(err)
	}
	doc.Find("div > p.ins.pro > span").Each(func(i int, s *goquery.Selection) {
		fmt.Println(i, s.Text())
	})
}
// prints: 0 C

I don't know where you've seen that goquery was compatible with jQuery, here's what the README says:

goquery brings a syntax and a set of features similar to jQuery to the Go language

What you may have seen, although it's hard to tell given the lack of details in your issue, is that the document you query with jQuery is actually modified via javascript, so when run in the browser, it has a different set of nodes (different html) than what you give to goquery (which only gets the static html source). See https://github.com/PuerkitoBio/goquery/wiki/Tips-and-tricks#handle-javascript-based-pages for community-provided options to handle this.

As for the Find method and the selector support, as noted in the README, goquery relies on the cascadia package which handles a pretty large number of complex selectors, but not necessarily all those supported by jQuery's sizzle selector library.

Martin

taitelman

comment created time in a month

issue closedmna/redisc

is HMSET operation supported, when using redis clustermode enabled?

currently i am using redis with cluster mode enabled with following config, cluster := redisc.Cluster{ StartupNodes: []string{"******.clustercfg.use1.cache.amazonaws.com:6379"}, DialOptions: []redis.DialOption{redis.DialConnectTimeout(5 * time.Second)}, CreatePool: createPool, }

and doing the following operation: hmsetargs := make([]interface{}, len(tags)+1) hmsetargs[0] = constant.ROOT_KEY for k, v := range tags { hmsetargs = append(hmsetargs, k, v) } tempcon := pool.Get() // make it handle redirections automatically conntoset, err := redisc.RetryConn(tempcon, 3, 100*time.Millisecond) if err != nil { log.Error().Err(err).Msg("RetryConn failed: ") }

_, err = conntoset.Do("hmset", hmsetargs...)
tempcon.Close()

and i am seeing this error: "error":"ERR wrong number of arguments for HMSET"

closed time in a month

prabhu352

issue commentPuerkitoBio/goquery

why get null html

Any news on this?

AiPacino

comment created time in a month

startedrxi/lite

started time in a month

pull request commentPuerkitoBio/goquery

Go syntax added

Thanks!

AbhigyanKumar

comment created time in a month

push eventPuerkitoBio/goquery

Abhigyan Kumar

commit sha 0132bb8147c49abf73ac282980caeb69c24275d4

Go syntax Go syntax colouring added.

view details

Martin Angers

commit sha c942deb265ea836470983fdf25e1858304bb6896

Merge pull request #347 from AbhigyanKumar/patch-1 Go syntax added

view details

push time in a month

PR merged PuerkitoBio/goquery

Go syntax added

I have added Go syntax highlighting.

+3 -3

0 comment

1 changed file

AbhigyanKumar

pr closed time in a month

issue commentPuerkitoBio/goquery

why get null html

Hello,

Please provide a minimal, runnable program with data that reproduces the problem without other dependencies (e.g. gin, web server). Also, make sure to check all errors.

Martin

AiPacino

comment created time in a month

issue commentmna/redisc

is HMSET operation supported, when using redis clustermode enabled?

Hello,

Yes it is supported, that command is part of the test suite of redisc (https://github.com/mna/redisc/blob/master/cluster_test.go#L232). Note that according to the redis website, as of redis 4.0 it is now considered deprecated (in favor of HSET, https://redis.io/commands/hmset).

Looking at your code, I believe the issue is that you create your slice with a predefined length (as opposed to capacity) and then you append to it, so a number of arguments are just nil:

hmsetargs := make([]interface{}, len(tags)+1)
// vs
hmsetargs := make([]interface{}, 0, len(tags)+1)
// although note that even that is not quite correct, because
// for each tag you actually append *2* values, so this would be best (untested):
hmsetargs := make([]interface{}, 0, (2 * len(tags))+1)
// ...

// however now you have a slice of 0-len and N-capacity, so you must change
hmsetargs[0] = constant.ROOT_KEY
// which would panic, to
hmsetargs = append(hmsetargs, constant.ROOT_KEY)

Hope this helps, Martin

prabhu352

comment created time in a month

fork mna/lua

The Lua repo, as seen by the Lua team. Mirrored irregularly. Please DO NOT send pull requests. Send issues/patches to the Lua mailing list https://www.lua.org/lua-l.html

https://www.lua.org/

fork in 2 months

issue closedPuerkitoBio/goquery

Scraping Help(HTMP Parser)

Can you help me with the code below? I extracted the domain as output using curl, grep, pup commands. I want to do this with golang, but I couldn't. Can you help?

curl -s "https://rapiddns.io/sameip/176.28.50.165#result"|grep "blank"|grep "http"|pup 'a text{}'
vulnweb.com
viruswall.vulnweb.com
...

package main

import (
	"fmt"
	"log"

	"github.com/PuerkitoBio/goquery"
)

func main() {
	doc, err := goquery.NewDocument("https://rapiddns.io/sameip/176.28.50.165#result")
	if err != nil {
		log.Fatal(err)
	}
	doc.Find(".posts-list td").Each(func(i int, s *goquery.Selection) {
		domain := s.Find("a").Text()
		fmt.Printf("%s\n", domain)
		//<td><a href="http://bing.com" target="_blank">bing.com</a></td> find=>bing.com
		//<td><a href="/some/13.107.21.200" target="_blank" title="13.107.21.200 reverse ip">13.107.21.200</a></td>
	})
}

Output

vulnweb.com
176.28.50.165

viruswall.vulnweb.com
176.28.50.165
...

closed time in 2 months

secfb

issue commentPuerkitoBio/goquery

Scraping Help(HTMP Parser)

You should look at the html of the selections that you loop upon, and check from that how you can extract just the domain name. You can use https://godoc.org/github.com/PuerkitoBio/goquery#OuterHtml to get that: s, err := goquery.OuterHtml(s).

secfb

comment created time in 2 months

startedtboox/ltui

started time in 2 months

created tagmna/tcheck

tagv0.1

Simple Lua module of sanity-checks for types (mirror)

created time in 2 months

create barnchmna/tcheck

branch : master

created branch time in 2 months

created repositorymna/tcheck

Simple Lua module of sanity-checks for types (mirror)

created time in 2 months

create barnchmna/xpgsql

branch : master

created branch time in 2 months

created tagmna/xpgsql

tagv0.1

Lua module providing a straightforward API to the luapgsql library.

created time in 2 months

created repositorymna/xpgsql

Lua module providing a straightforward API to the luapgsql library.

created time in 2 months

issue commentmna/redisc

Separate pool for masters and slaves?

If you don't have a redis cluster, you shouldn't use this package, it will only add overhead. If you do have a cluster, you should call Refresh before you start getting connections from the Cluster (typically at startup in your main), in order to avoid paying the cost of the cluster discovery on first use.

In the future please open new issues when you have different questions instead of reopening an unrelated one.

Martin

JulieVogelman

comment created time in 2 months

issue commentmna/redisc

Separate pool for masters and slaves?

Yes, basically you do:

conn := cluster.Get()
defer conn.Close()
// using redisc.ReadOnlyConn is easier than calling conn.ReadOnly() because 
// the connection returned by cluster.Get()
// is of type redis.Conn, you'd have to convert it to *redisc.Conn otherwise.
if err := redisc.ReadOnlyConn(conn); err != nil {
    // handle error...
}
// use the conn for readonly queries, e.g.:
s, err := redis.String(conn.Do("GET", "some-key"))
if err != nil {
    // handle error...
}
JulieVogelman

comment created time in 2 months

issue commentmna/redisc

Separate pool for masters and slaves?

Hello,

I'm not familiar with helm but yes for a given Redis cluster, you should use a single redisc.Cluster with some known valid startup node addresses, and it will automatically detect the cluster. The underlying pools are managed automatically, one pool is created for each node. To direct your read-only queries to replica nodes, you call conn.ReadOnly() before running commands with that connection (see https://godoc.org/github.com/mna/redisc#Conn.ReadOnly).

Hope this helps, Martin

JulieVogelman

comment created time in 2 months

startedgolgote/neturl

started time in 3 months

pull request commentPuerkitoBio/goquery

Convert int to string using fmt.Sprintf

Merci Robert-André!

J'ai finalement opté pour strconv.Itoa qui est plus efficace, pour limiter l'impact sur le benchmark. En tant qu'utilisateur de Fedora, j'apprécie beaucoup ton travail de packager :pray:

Martin

eclipseo

comment created time in 3 months

PR merged PuerkitoBio/goquery

Convert int to string using fmt.Sprintf

See https://github.com/golang/go/issues/32479

Fix #341.

Signed-off-by: Robert-André Mauchin zebob.m@gmail.com

+2 -1

0 comment

1 changed file

eclipseo

pr closed time in 3 months

push eventPuerkitoBio/goquery

Robert-André Mauchin

commit sha 51a0e1a4bbcd0b7ee4d41537a3dee63db8191187

Convert int to string using fmt.Sprintf See https://github.com/golang/go/issues/32479 Fix #341. Signed-off-by: Robert-André Mauchin <zebob.m@gmail.com>

view details

Martin Angers

commit sha cd12820764716542c6b832d41ad9a06105b3b656

use strconv.Itoa instead of fmt.Sprintf

view details

Martin Angers

commit sha 6f0f9d6b87b3ab53ab8dfc9cdda07ba5bbdd57a3

Merge branch 'eclipseo-fix_conversion_int_to_string'

view details

push time in 3 months

issue closedPuerkitoBio/goquery

Go 1.15: conversion from int to string yields a string of one rune

Go 1.15 rc 1 on Fedora Rawhide:

Testing    in: /builddir/build/BUILD/goquery-1.5.1/_build/src
         PATH: /builddir/build/BUILD/goquery-1.5.1/_build/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin
       GOPATH: /builddir/build/BUILD/goquery-1.5.1/_build:/usr/share/gocode
  GO111MODULE: off
      command: go test -buildmode pie -compiler gc -ldflags "-X github.com/PuerkitoBio/goquery/version=1.5.1 -extldflags '-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '"
      testing: github.com/PuerkitoBio/goquery
github.com/PuerkitoBio/goquery
# github.com/PuerkitoBio/goquery
./bench_iteration_test.go:34:10: conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)
FAIL	github.com/PuerkitoBio/goquery [build failed]

Please see https://github.com/golang/go/issues/32479

closed time in 3 months

eclipseo

issue closedPuerkitoBio/goquery

Go 1.15: conversion from int to string yields a string of one rune

Go 1.15 rc 1 on Fedora Rawhide:

Testing    in: /builddir/build/BUILD/goquery-1.5.1/_build/src
         PATH: /builddir/build/BUILD/goquery-1.5.1/_build/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin
       GOPATH: /builddir/build/BUILD/goquery-1.5.1/_build:/usr/share/gocode
  GO111MODULE: off
      command: go test -buildmode pie -compiler gc -ldflags "-X github.com/PuerkitoBio/goquery/version=1.5.1 -extldflags '-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '"
      testing: github.com/PuerkitoBio/goquery
github.com/PuerkitoBio/goquery
# github.com/PuerkitoBio/goquery
./bench_iteration_test.go:34:10: conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)
FAIL	github.com/PuerkitoBio/goquery [build failed]

Please see https://github.com/golang/go/issues/32479

closed time in 3 months

eclipseo

push eventmna/luasock99

Martin Angers

commit sha b7dc7a988d0bc3c4d8aa0b5bb7e7c4c799dd825c

add license

view details

push time in 3 months

created tagmna/luasock99

tagv0.1

Lua module for the socket99 C library. (mirror)

created time in 3 months

create barnchmna/luasock99

branch : master

created branch time in 3 months

created repositorymna/luasock99

Lua module for the socket99 C library. (mirror)

created time in 3 months

more