cases_click_curl.py 473 B

1234567891011121314151617181920212223
  1. import codecs
  2. import random
  3. import os
  4. import time
  5. fpath=__file__
  6. fpath=fpath.replace('cases_click_curl.py','cases.csv')
  7. print(fpath)
  8. lst=[]
  9. fr=codecs.open(fpath,'r','utf-8')
  10. lines=fr.readlines()
  11. for l in lines:
  12. elmts=l.split(',')
  13. lst.append('https://www.hhh.com.tw'+elmts[0])
  14. fr.close()
  15. #for i in range(20):
  16. while True:
  17. l=random.choice(lst)
  18. os.system('docker run --rm curlimages/curl:7.79.1 -L -v '+l)
  19. # os.system('curl '+l)
  20. time.sleep(4)
  21. print(l)