curl_click.py 552 B

123456789101112131415161718192021222324252627
  1. import codecs
  2. import random
  3. import os
  4. import time
  5. fpath=__file__
  6. fpath=fpath.replace('curl_click.py','urls.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 -Lx http://127.0.0.1:8118 '+l)
  20. os.system('phantomjs '+l)
  21. # os.system('curl '+l)
  22. # time.sleep(1)
  23. print(l)