Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import time
- import matplotlib.pyplot as plt
- import pandas as pd
- d = {
- "selenium": [],
- "bs4": []
- }
- N = 1000
- for i in range(N):
- print("-"*20, f"Experiment {i+1}", "-"*20)
- t0 = time.time()
- os.system("python3 'beautifulsoup script.py'")
- t1 = time.time()
- os.system("python3 'selenium script.py'")
- t2 = time.time()
- d["selenium"].append(t2-t1)
- d["bs4"].append(t1-t0)
- df = pd.DataFrame(d)
- df.to_csv("data.csv", index=False)
Advertisement
Add Comment
Please, Sign In to add comment