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
@contextmanager | |
def selen(driver_patch: str, profile_patch: str, config='windows') -> webdriver.Chrome: | |
""" | |
Самый удобный метод использования веб драйвера =) | |
:param driver_patch: str: patch to chromedriver(exe) | |
:param profile_patch: str: the path to the folder storing cookies | |
:param config: str: operating system | |
:return: webdriver.Chrome | |
""" |
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 pytest | |
from selenium import webdriver | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
import time | |
import math | |
links = [ # Список ссылок на тестируемые страницы |
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
### Keybase proof | |
I hereby claim: | |
* I am moonzlo on github. | |
* I am moonz (https://keybase.io/moonz) on keybase. | |
* I have a public key ASB8tJsmYi6Cf7M0uJMfSH04imnSmnORix9L6-fABPFsFwo | |
To claim this, I am signing this object: |
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
tree = etree.HTML(html) | |
for block in tree.xpath("//div[@class='product']"): | |
img = block.xpath("//img/@src")[0] | |
name = block.xpath("//tr[@class='name']")[0].text | |
id = block.xpath("//tr[@class='id']")[0].text |
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 __future__ import annotations | |
from abc import ABC, abstractmethod | |
class AbstractFactory(ABC): | |
""" | |
Интерфейс Абстрактной Фабрики объявляет набор методов, которые возвращают | |
различные абстрактные продукты. Эти продукты называются семейством и связаны | |
темой или концепцией высокого уровня. Продукты одного семейства обычно могут | |
взаимодействовать между собой. Семейство продуктов может иметь несколько |
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 File(object): | |
def __init__(self, filename, flag): | |
self.filename = filename | |
self.flag = flag | |
def __enter__(self): | |
print('Взял файл и открыл') | |
self.open_file = open(self.filename, self.flag) | |
return self.open_file | |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 requests, json, time, winsound | |
from bs4 import BeautifulSoup | |
# очищаем консоль от мусора в виде результатов | |
# проигрываем звук при появлении ссылки | |
frequency = 670 # Set Frequency To 2500 Hertz | |
duration = 1000 # Set Duration To 1000 ms == 1 second | |
saveResult = [] |
NewerOlder