update_urllist.py 363 B

1234567891011121314
  1. import dataset
  2. db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/seo?charset=utf8mb4')
  3. table=db['seo_nton_custurl']
  4. cust = "The Icons_EN"
  5. with open("list.txt", "r") as file:
  6. for line in file:
  7. if line != "":
  8. url = line.replace('\n', '')
  9. table.insert({'cust':cust,'url':url})
  10. else:
  11. print("Empty data")