Skip to content

Is it a bug? #6

Closed
Closed

Description

@Protoculos

`func main() {

doc, err := htmlquery.LoadURL(`http://episcopia-ungheni.md/ru/fara-categorie-ru/%d0%b0%d0%ba%d0%b0%d1%84%d0%b8%d1%81%d1%82%d0%bd%d0%be%d0%b5-%d0%bf%d0%b5%d0%bd%d0%b8%d0%b5-%d0%bf%d0%b5%d1%80%d0%b5%d0%b4-%d0%b8%d0%ba%d0%be%d0%bd%d0%be%d0%b9-%d0%b1%d0%be%d0%b6%d0%b8%d0%b5%d0%b9-5/`)
if err != nil {
	log.Println(err)
}
for i, v := range htmlquery.Find(doc, `//*[contains(@class,"gallery")]//a/@href`) {
	t := htmlquery.InnerText(v)
	fmt.Println(i, strings.TrimSpace(t))
}

}`

In other programs I got 1 url.
And this I got 4 same urls.
From source code it's 1 url.

Activity

  1. changed the title [-]Is it a bag?[/-] [+]Is it a bug?[/+] on Dec 27, 2018
  2. zhengchun commented on Dec 28, 2018

    @zhengchun
    Contributor

    Actually, it is not a bug, but it maybe become a problem. //*[contains(@class,"gallery")] matches 4 elements that all including a element. The tmlquery.Find method not remove all duplicate element, we will improve this method.
    Thanks for the feedback.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址