hhh_404_manager.py 734 B

123456789101112131415161718192021
  1. from seleniumwire import webdriver # Import from seleniumwire
  2. import time
  3. import requests
  4. import sys
  5. import dataset
  6. import os
  7. fname=os.path.abspath(__file__)
  8. fname=fname.replace('hhh_404_manager.py','hhh_404.py')
  9. db = dataset.connect('mysql://hhh7796hhh:lYmWsu^ujcA1@hhh-v57.cmab1ctkglka.ap-northeast-2.rds.amazonaws.com:3306/xoops?charset=utf8mb4')
  10. cursor=db.query('SELECT hcolumn_id FROM xoops._hcolumn where onoff>0 order by rand() limit 1;')
  11. for c in cursor:
  12. print(c['hcolumn_id'])
  13. os.system('python3 hhh_404.py https://hhh.com.tw/columns/detail/'+str(c['hcolumn_id'])+'/')
  14. os.system('python3 hhh_404.py https://www.hhh.com.tw/')
  15. os.system('python3 hhh_404.py https://m.hhh.com.tw/hhh-home-mb/index.html')