This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
from selenium.webdriver.common.proxy import Proxy, ProxyType | |
URL = "https://www.ozon.ru/category/telefony-i-smart-chasy-15501/?sorting=rating" | |
# proxy list: https://freeproxylists.net/ru.html | |
proxy_addr = '93.123.226.23' | |
proxy_port = '81' | |
prox = Proxy() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from task1 import get_score, INITIAL_STAMP, generate_game, ScoreException | |
def extract_scores(d: dict): | |
return ((d2 := d['score'])['home'], d2['away']) | |
class TestStringMethods(unittest.TestCase): | |
def setUp(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ScoreException(Exception): | |
pass | |
def get_score(game_stamps, offset): | |
''' | |
Takes list of game's stamps and time offset for which returns the scores for the home and away teams. | |
Please pay attention to that for some offsets the game_stamps list may not contain scores. | |
''' | |
def extract_scores(d: dict): |