Saturday 18 March 2017

Write after end Error when piping to parse5 parser

I have made a promise based fetch function which resolves when the response from http.get. I want to parse the response using the parse5 SAXParser. when i pipe the response I get a write after end error.

            Urls.map( async url => {
            try {
                    parser1=new parse5.SAXParser()
                    parser1.on('text',(a)=>{
                            console.log(`in the parser with url${url}`)
                            console.log('parser')
                    })
                    webpage=await fetch(url)
                    webpage.pipe(parser1)
            }



via user3302146

No comments:

Post a Comment