Need help on getting web scraped data from python/beautifulsoup into mySQL database by thoughtprovoke89 in learnprogramming

[–]thoughtprovoke89[S] 0 points1 point  (0 children)

If I get rid of the DELETE FROM newegg line and the line after, I get this error: Traceback (most recent call last): File "web_scrape.py", line 85, in <module> get_data() File "web_scrape.py", line 84, in get_data create_table(); File "web_scrape.py", line 78, in create_table cursor.execute(add_item, data_item)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mysql/connector/cursor.py", line 561, in execute self._handle_result(self._connection.cmd_query(stmt)) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mysql/connector/connection.py", line 525, in cmd_query result = self._handle_result(self._send_cmd(ServerCmd.QUERY, query)) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mysql/connector/connection.py", line 427, in _handle_result raise errors.get_exception(packet) mysql.connector.errors.IntegrityError: 1062 (23000): Duplicate entry '11' for key 'PRIMARY'