Skip to content

Instantly share code, notes, and snippets.

@ocvs
ocvs / exercicio_07.py
Created June 20, 2020 21:16
Exercicio_07
from selenium.webdriver import Firefox
from time import sleep
from urllib.parse import urlparse, parse_qsl
from selenium.webdriver.support.events import (
AbstractEventListener, EventFiringWebDriver
)
import json
class Escuta(AbstractEventListener):
@ocvs
ocvs / exercicio_3.py
Created May 16, 2020 17:18
Curso selenium Dunossauro exercicio 3
from selenium.webdriver import Firefox
from urllib.parse import urlparse
from time import sleep
def find_by_text(browser, tag, text):
"""Encontrar o elemento com o texto `text`.
Argumentos:
- browser = Instancia do browser [firefox, chrome, ...]
- texto = conteúdo que deve estar na tag
- tag = tag onde o texto será procurado
@ocvs
ocvs / Duvida
Last active July 31, 2019 20:46
from pprint import pprint
lista_original = [25, 22, 17, 17, 18, 18, 16, 27, 24, 24, 19, 20, 28, 28, 23, 26, 30, 29, 31, 21]
nova_lista=[]
for tripla in zip(lista_original[:-1],lista_original[1:],lista_original[2:]):
if len(tripla) == len(set(tripla)):
if len(nova_lista)>0:
if nova_lista[-1][-1]!=tripla[0]:
nova_lista.append(tripla)
@ocvs
ocvs / tkinter
Last active July 11, 2019 02:44
class StColors(object):
orange = '#f5be2e'
bright_green = '#b7f731'
dark_grey = '#191919'
mid_grey = '#323232'
light_grey = '#c8c8c8'
def create_widgets(self, master):
style = Style()