Skip to content

Instantly share code, notes, and snippets.

@fuwiak
Created July 23, 2020 09:35
Show Gist options
  • Save fuwiak/47368f55a0966dfe427035f5b289edb0 to your computer and use it in GitHub Desktop.
Save fuwiak/47368f55a0966dfe427035f5b289edb0 to your computer and use it in GitHub Desktop.
import random
import traceback
import urllib.request
import re
import requests
import time
from PIL import Image
from bs4 import BeautifulSoup
import urllib.request
url = f'https://fast.com/'
response = (urllib.request.urlopen(url)).read()
soup = BeautifulSoup(response, "html.parser")
time.sleep(3)
# date = re.search('<div class="speed-results-container succeeded" id="speed-value">"(.+)"></div>', str(soup))
mydivs = soup.findAll("div", {"class": "speed-results-container"})
#id
print("Name of id", mydivs[0].get("id"))
print('Value of id= ', mydivs[0].text.strip())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment