File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ type Datum = {
67
67
if ( ! error || error . message !== "Error: socket hang up" ) {
68
68
throw error
69
69
}
70
- logger . log ( "Failed: %s" , error )
70
+ logger . log ( error . message , "then retry." )
71
71
await new Promise ( resolve => setTimeout ( resolve , 2000 ) )
72
72
}
73
73
} while ( window == null )
@@ -149,10 +149,9 @@ function collectValues(
149
149
id : string ,
150
150
existingSet : Set < string > ,
151
151
) : string [ ] {
152
- return Array . from (
153
- window . document . querySelectorAll ( `${ id } td:nth-child(1) code` ) ,
154
- node => node . textContent || "" ,
155
- )
152
+ const selector = `${ id } td:nth-child(1) code`
153
+ const nodes = window . document . querySelectorAll ( selector )
154
+ const values = Array . from ( nodes , node => node . textContent || "" )
156
155
. filter ( value => {
157
156
if ( existingSet . has ( value ) ) {
158
157
return false
@@ -161,6 +160,16 @@ function collectValues(
161
160
return true
162
161
} )
163
162
. sort ( undefined )
163
+
164
+ logger . log (
165
+ "%o nodes of %o were found, then %o adopted and %o ignored as duplication." ,
166
+ nodes . length ,
167
+ selector ,
168
+ values . length ,
169
+ nodes . length - values . length ,
170
+ )
171
+
172
+ return values
164
173
}
165
174
166
175
function makeVerificationCode (
You can’t perform that action at this time.
0 commit comments