Commit Graph

219 Commits

Author SHA1 Message Date
Martin Angers
5dccaa115b optimize winnowNodes and ClosestNodes in the same way 2016-08-28 11:55:36 -04:00
Martin Angers
26f4f54c91 simplify string search expressions, remove unused code 2016-08-28 11:09:29 -04:00
Martin Angers
e89fe653fd update README for v1.0.1 2016-08-28 11:06:06 -04:00
Martin Angers
ab2bb46123 update pre-commit hook with other static checks 2016-08-28 11:04:26 -04:00
Martin Angers
b91267330e add tests and benchmark for appendWithoutDuplicates optimization 2016-08-28 11:03:18 -04:00
Martin Angers
d85ad7e2ed remove var declaration 2016-08-27 22:44:10 -04:00
Martin Angers
6841d28c6f comment and explain the appendWithoutDuplicates logic 2016-08-27 22:29:53 -04:00
Martin Angers
7bd630023a reuse the deduplication set map in mapNodes 2016-08-27 22:25:02 -04:00
Martin Angers
c7533ba696 maintain a set of existing target nodes to deduplicate
The old implementation used nested loops to check if one of the
new nodes was already in the existing nodes. This commit
maintains a map[*html.Node]bool so that a single loop over
the new elements is required. This is slower for small
slices though, and allocates more. The next step is for
appendWithoutDuplicates to accept a map as argument so
that the set is not recreated on each call from mapNodes.
2016-08-27 18:55:21 -04:00
Martin Angers
ad8b3d8222 remove logging from benchmarks, validate expected result instead 2016-08-27 18:37:55 -04:00
Martin Angers
7f4291566c tag v1.0.0, closes #124 v1.0.0 2016-07-27 21:43:13 -04:00
Martin Angers
f0d75731e0 fix example, closes #120 2016-06-29 08:59:28 -04:00
Martin Angers
77cbaef46a Merge pull request #115 from PuerkitoBio/i114
Treat invalid selector strings as a Matcher that doesn't match anything
2016-06-15 09:48:05 -04:00
Martin Angers
2441483128 update doc 2016-06-15 09:40:19 -04:00
Martin Angers
2ab590df05 use a failing matcher if selector fails to compile, adjust tests 2016-06-15 09:27:17 -04:00
Martin Angers
9cc531274b implement tests for selection methods with invalid selector strings 2016-06-15 08:42:27 -04:00
Martin Angers
2cd8b4e49a test all go versions since 1.1 2016-06-15 07:50:27 -04:00
Martin Angers
aeecb06b1e doc: better explain the arguments to the function passed to Each and Map, closes #107 2016-05-26 08:12:20 -04:00
Martin Angers
2e29ea41f0 add a test for issue #103 2016-04-08 07:41:18 -04:00
Martin Angers
5cc721859e edit example to follow Go conventions 2016-04-08 07:39:02 -04:00
Martin Angers
4126223a86 exclude testdata/ files from github language stats 2016-02-16 20:35:17 -05:00
Martin Angers
81e6517758 doc: fix list for godoc 2016-02-02 12:40:27 -05:00
Martin Angers
bb16855614 Merge pull request #102 from PuerkitoBio/helper-funcs
add NodeName and OuterHtml utility functions, closes #96 and #101 .
2016-02-02 12:37:00 -05:00
Martin Angers
b0437209ef add NodeName and OuterHtml utility functions 2016-02-02 12:28:50 -05:00
Martin Angers
417cce822c return error if response`s request is nil on NewDocumentFromResponse 2015-09-27 16:28:20 -04:00
Martin Angers
b4440419d8 make AttrOr return default value if selection is empty 2015-06-05 22:16:32 -04:00
Martin Angers
60ec77b003 doc: document AttrOr addition 2015-04-20 19:20:24 -04:00
Martin Angers
a8c8239eb6 Merge pull request #73 from piotrkowalczuk/master
Selection.AttrOr shorthand method
2015-04-20 19:17:32 -04:00
Piotr Kowalczuk
c416dcdfae Selection.AttrOr test 2015-04-17 00:38:27 +02:00
Piotr Kowalczuk
23904f6805 Selection.AttrOr shorthand method 2015-04-17 00:30:41 +02:00
Martin Angers
5203bc06da Merge pull request #72 from bfontaine/patch-1
Typo in NewDocumentFromResponse doc
2015-04-09 13:50:05 -04:00
Baptiste Fontaine
2d28dba982 Typo in NewDocumentFromResponse doc 2015-04-09 19:33:38 +02:00
Martin Angers
269246d9e7 doc: fix obsolete links in README 2015-03-28 09:30:56 -04:00
Martin Angers
55f7879c98 Merge pull request #68 from pacificporter/cascadia_has_moved
cascadia has moved.
2015-03-28 09:20:13 -04:00
HARUYAMA Seigo
d9b2b5ed51 cascadia has moved.
code.google.com/p/cascadia
->
github.com/andybalholm/cascadia
2015-03-28 11:15:11 +09:00
Martin Angers
4cf64c51f7 Merge branch 'thatguystone-master' 2015-02-04 20:43:27 -05:00
Martin Angers
fe61b74344 document Prepend addition 2015-02-04 20:43:02 -05:00
Andrew Stone
edcb3e4b1e manipulation: Add Prepend*()
Looks like I missed yet another manipulation function.
2015-02-04 11:28:51 -05:00
Martin Angers
12a46cd4a1 Merge pull request #58 from jpillora/master
SetAttr now creates attributes, in addition to updating attributes, clos...
2014-12-09 22:34:46 -05:00
Jaime Pillora
51379dc225 SetAttr now creates attributes, in addition to updating attributes, closes #57 2014-12-06 18:53:56 +11:00
Martin Angers
0db8a55dc4 fix doc alignment 2014-11-28 11:55:26 -05:00
Martin Angers
2922326512 doc 2014-11-28 11:50:40 -05:00
Martin Angers
a923db6a4b review PR, fix WrapInner bug 2014-11-28 11:46:58 -05:00
Andrew Stone
2455631714 manipulation: Add Unwrap() 2014-11-12 10:37:11 -05:00
Andrew Stone
162ad3a767 manipulation: add ReplaceWith*() functions 2014-11-12 10:37:11 -05:00
Andrew Stone
ca48f5f409 manipulation: add Wrap*() functions 2014-11-12 10:37:11 -05:00
Martin Angers
ffa8a68c9f accept variadic class names in AddClass 2014-11-07 22:08:57 -05:00
Martin Angers
39d99e8fa4 remove fmt dependency 2014-11-07 13:21:28 -05:00
Martin Angers
522e116ada doc again 2014-11-07 12:36:55 -05:00
Martin Angers
b89597bb36 doc 2014-11-07 12:33:22 -05:00