Documentation on debugging issue for creating database
While running the crawler code to extract data about the categories(Beauty -> Tools and Accessories products) in amazon.in, I had come across the following error. I will be showing what I had done to rectify the error.
runfile(‘C:/Users/Dell/Documents/Quilt/quilt-beauty/quilt-beauty/amazon_beauty_skin_crawler.py’, wdir=’C:/Users/Dell/Documents/Quilt/quilt-beauty/quilt-beauty’)
Error tokenizing data. C error: Expected 7 fields in line 68, saw 8
If you look at the database, the database will be empty.
To look at the database, open the ‘db.sqlite3’ file using DB Browser (SQLite) application.
To rectify the error, we need to open the .csv in a normal word editor e.g. notepad++
You will be able to see the ‘ ” ’ double quotes at the beginning and at the end.
Remove the double quotes and save the text file.
NOTE: If there are already data in the database, to remove the data from the database do the following.
Open the db.sqlite3 file using DB Browser (SQLite) application.
Go to ‘Execute SQL’ tab
Type the following command
delete from file_name
delete from beauty_skin_categories
The above command will delete the data that was present in the database.
To execute the command run the command, click the run button.
After running the command click ‘Write Changes’
Then open Spyder and run the code. This time it should work.
The database for the beauty_skin_categories table will be created.
Author
prathap7618@gmail.com
Related Posts
How to Install WSL and Ubuntu (LTS) on the Windows platform
~Sandhiya.B and Ajay This post consolidates the information needed to set up the Ubuntu terminal on a Win 11 Machine. The Ubuntu terminal...
Read out allAmbient light sensor using a photoresistor and Arduino Uno
This project is about using a photoresistor along with an Arduino Uno board to determine the brightness of a room which is...
Read out allSmart dustbin using Arduino
The smart dustbin is built on a microcontroller-based platform Arduino Uno board which is interfaced with the Servo motor and ultrasonic sensor....
Read out allLOGIC GATES USING ARDUINO UNO
A basic gate is defined as a component with one or more inputs and one output. The inputs and outputs are all...
Read out allLAST SCHOOL STUDENTS VISIT STEMLAND
On the 14th of July students from the Last school, Auroville visited STEMLAND. The forty students accompanied by the teachers enjoyed their...
Read out allVim Editor Session
Vim Editor Session ~SriBhavani and Bakyalakshmi On 18th Jan 2022, we had a session on vim by HarshaVaradhan from AuraSemiconductors. In this...
Read out all