실전 - 크롤링(식품안전나라 with api)
import datetime, re import pymysql import json from urllib.request import urlopen from bs4 import BeautifulSoup key = '제공받은 키' conn = pymysql.connect(host='db 주소',\ user = 'root', passwd='db 루트의 비번', db='mysql', port = 3306, charset = 'utf8') cur = conn.cursor() cur.execute("USE foodvar") """ def store(title, content) : cur.execute( "INSERT INTO pages(title, content) values (\"%s\", \"%s\")", (t..