I'm trying to access the data in a without success I tried all the documentation that I found without success hope for help from a genius ...
request( "https://www.answers.com/Q/What_are_examples_of_prefixes_and_suffixes", (error, response, html) => { if (!error && response.statusCode == 200) { let $ = cheerio.load(html) // here what can i do to find the data for the <script> console.log((str = $("script")[0].children[0].data)) console.log("Scraping Done...") } else { console.log("Scrapping Failed") console.log(error) } } )
Just use regex on the whole response:
json = html.match(/window.appConfig = ({.*})/)[1]
1.2m questions
2.1m answers
5 comments
56.5k users