-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_internet_speed.py
28 lines (23 loc) · 1019 Bytes
/
get_internet_speed.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from selenium import webdriver
from selenium.webdriver.common.by import By
import time
chrome_driver_path = "C:/Users/robertp/Development/chromedriver.exe"
driver = webdriver.Chrome(chrome_driver_path)
url = "https://www.speedtest.net/"
email = "[email protected]"
password = "#rrRRPWP5916"
class GetInternetSpeed:
def __init__(self):
pass
# load internet speed checker website
driver.get(url)
time.sleep(5)
driver.find_element(By.CLASS_NAME, "start-button").click()
time.sleep(75)
# record results from speed test
self.down = driver.find_element(By.CSS_SELECTOR,
'span[class="result-data-large number result-data-value download-speed"]')
self.up = driver.find_element(By.CSS_SELECTOR,
'span[class="result-data-large number result-data-value upload-speed"]')
self.down = self.down.text
self.up = self.up.text