Open WayneRose-95 opened 2 years ago
The .json error has now been debugged, and the file creates a valid .json file using the sample_text_output file.
Moving onto the accept_cookies and .csv methods.
Potentially, the .csv and .json methods could be encapsulated into one method.
A new method, _save_json has been added, and the accept_cookies method has been adjusted to become more robust across other websites.
New accept_cookies method has been refactored:
For the above method, a suitable unit-test must be written to test its robustness across multiple websites.
And the _save_json method:
Both of these methods need to be unit-tested in order to test their robustness.
After which, the _save_json method needs to be implemented within the main method of the scraper.
When unit-testing the _save_json method, the goal is to convert an output into a .json file.
An output such as this:
Should be converted into a .json file and a new directory should be made to accommodate said files.
However, while testing the method, the following error occurs:
That said, the directory is created and the file name is also named accordingly.
This error must be debugged in order to satisfy the unit-test conditions.