Help! Started working with Python om recently. Wrote scraper, which pulls the metadata from Google Play. Climb the data and displayed normally (ie, Cyrillic is not spilling), but when I try to record these data into the database (the sounds of the module MySQLdb), once I found the entry with the Cyrillic alphabet in the box throws the following:
_mysql_exceptions.OperationalError: (1366, “Incorrect string value: ‘\\\\xF0\\\\x9F\\\\x8D\\\\x80’ for column ‘title’ at row 1”)
The encoding of the database, tables and fields utf8_general_ci.
Connection to database set as follows:
conn = MySQLdb.connect('localhost', 'VProgramMist', '1998Vm0000', 'mobasta_history', charset='utf8', init_command='SET NAMES UTF8')
Write the data into the database the following:
sql_str = ""INSERT INTO history (app_id, title, score, price, free, iap, iap_range, size, installs, content_rating, date_point, category, collection) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)"" cursor.execute(sql_str, ( row['app_id'], row['title'], row['score'], row['price'], row['free'], row['iap'], row['iap_range'], row["size"], row['installs'], row['content_rating'], datetime.date.today(), row['category'], row['collection']))
The Version Of Python 3.7
Version Of MySQL - 5.7
PS I Decided to write each a matter of record. Saw that in the database row is written with the Cyrillic alphabet. Ie, something he writes, and something (for example, when it comes to the application "Yule"), it all goes to hell...