You mentioned today that there should already be a stored json file that contains all of the questions/answers. Lucas and I were able to find that through this url, but it's in a JavaScript format. I think the actual json part for questions and answers is contained within this function:
function(e){e.exports=JSON.parse(
...
)}
but we're lost on how to extract the questions and answers since it's a JS file. (I'm assuming we can't use bs4 to parse through JS?)
Side node: I noticed that each url for each chapter/quiz has div tags that can be scraped using bs4 to extract all of the questions and answers (since they're html files), but I wasn't sure if that would be unnecessary/inefficient work considering we have a centralized JS file that already contains all of the questions and answers. I was wondering if you had any suggestions/if you think we're approaching it the wrong way? Thank you!
Hi Mike!
You mentioned today that there should already be a stored json file that contains all of the questions/answers. Lucas and I were able to find that through this url, but it's in a JavaScript format. I think the actual json part for questions and answers is contained within this function:
but we're lost on how to extract the questions and answers since it's a JS file. (I'm assuming we can't use bs4 to parse through JS?)
Side node: I noticed that each url for each chapter/quiz has
div
tags that can be scraped using bs4 to extract all of the questions and answers (since they're html files), but I wasn't sure if that would be unnecessary/inefficient work considering we have a centralized JS file that already contains all of the questions and answers. I was wondering if you had any suggestions/if you think we're approaching it the wrong way? Thank you!