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 = {
6767 if ( ! error || error . message !== "Error: socket hang up" ) {
6868 throw error
6969 }
70- logger . log ( "Failed: %s" , error )
70+ logger . log ( error . message , "then retry." )
7171 await new Promise ( resolve => setTimeout ( resolve , 2000 ) )
7272 }
7373 } while ( window == null )
@@ -149,10 +149,9 @@ function collectValues(
149149 id : string ,
150150 existingSet : Set < string > ,
151151) : 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 || "" )
156155 . filter ( value => {
157156 if ( existingSet . has ( value ) ) {
158157 return false
@@ -161,6 +160,16 @@ function collectValues(
161160 return true
162161 } )
163162 . 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
164173}
165174
166175function makeVerificationCode (
You can’t perform that action at this time.
0 commit comments