Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
[email protected] webmail now available. Want one? Go here.
Cannot use outlook/hotmail/live here to register as they blocking our mail servers. #microsoftdeez
Obey the Epel!

Paste

Pasted as Python by jaakko ( 4 years ago )
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 22 11:52:24 2020

@author: jaakko
"""

import requests
import tkinter as tk
import time

def hae_tagit(minhinta):
    link = "https://www.yksityisopetus.fi/opiskelijat/matematiikka/min-"
    link += str(minhinta)+"-per-tunti/uusin-ensin"
    f = requests.get(link)
    lista = f.text.split('\n')
    ilmot = []
    for i in range(len(lista)):
        if "<a href=\"/" in lista[i]:
            if "<a href=\"/opettajat" not in lista[i]:
                if "<a href=\"/contact" not in lista[i]:
                    if lista[i] not in ilmot:
                        ilmot.append(lista[i])
    return ilmot

hinta=5
tagit = hae_tagit(hinta)
tagit_viimeksi = ""
for i in tagit:
    print(i)
while True:
    tagit_viimeksi=hae_tagit(hinta)
    tagit.sort()
    tagit_viimeksi.sort()
    print(tagit)
    print(tagit_viimeksi)
    print(set(tagit)==set(tagit_viimeksi)) 
    if set(tagit_viimeksi) != set(tagit):
        print("Hei, muuttui jotenkin:")
        print(tagit_viimeksi)
        tagit=tagit_viimeksi
    time.sleep(5)

 

Revise this Paste

Your Name: Code Language: