alperiox

Untitled

Jan 11th, 2023
664
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. import os
  2. import time
  3. import matplotlib.pyplot as plt
  4.  
  5. import pandas as pd
  6.  
  7. d = {
  8.     "selenium": [],
  9.     "bs4": []
  10. }
  11.  
  12. N = 1000
  13.  
  14. for i in range(N):
  15.     print("-"*20, f"Experiment {i+1}", "-"*20)
  16.     t0 = time.time()
  17.     os.system("python3 'beautifulsoup script.py'")
  18.     t1 = time.time()
  19.     os.system("python3 'selenium script.py'")
  20.     t2 = time.time()
  21.     d["selenium"].append(t2-t1)
  22.     d["bs4"].append(t1-t0)
  23.  
  24. df = pd.DataFrame(d)
  25. df.to_csv("data.csv", index=False)
Advertisement
Add Comment
Please, Sign In to add comment