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 selenium | |
import time | |
import pandas as pd | |
import numpy as np | |
from time import sleep | |
from selenium import webdriver as wb | |
from tqdm import tqdm | |
import warnings | |
from warnings import simplefilter |
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
mlinks = pd.read_excel('C:/Users/Pablo Henrique/dataset_PremierLeague.xlsx') | |
mlinks.drop(['Unnamed: 0'], axis=1, inplace=True) | |
mlinks.head() |
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
#Website link | |
wd = wb.Chrome(executable_path=r'C:/Users/Pablo Henrique/chromedriver.exe') | |
wd.get('https://www.premierleague.com/') |
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
# Cria uma lista com os links de cada partida | |
list_mlinks = mlinks['link_match'] | |
# Cria dois objetos vazios, onde armazenaremos os resultados obtidos | |
data_matches = [] | |
data_h2h = [] | |
# Inicia o loop para percorrer todos os links | |
for link in tqdm(list_mlinks): | |
wd.get(link) #acessa o link da partida |