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.support.ui import Select | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
from selenium.webdriver.common.by import By | |
import os | |
import time | |
def login(browser): | |
# Entra com nome de usuário e senha |
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
[['SOSA4515240', 150, 'https://produto.mercadolivre.com.br/MLB-1104249558-capacete-para-moto-_JM'], ['VEROVEROMOTOS', 254.9, 'https://produto.mercadolivre.com.br/MLB-1103179117-capacete-peels-mirage-storm-_JM'], ['MOTOLOPES.COM.BR', 260, 'https://produto.mercadolivre.com.br/MLB-1010537625-capacete-peels-mirage-storm-preto-rosa-_JM'], ['ROTADOCAPACETE', 264.47, 'https://produto.mercadolivre.com.br/MLB-1135088554-capacete-peels-mirage-original-new-classic-_JM'], ['CENTRALMOTOS17', 266.31, 'https://produto.mercadolivre.com.br/MLB-1114344661-capacete-peels-mirage-storm-preto-vermelho-lancamento-_JM'], ['RACINGMOTOPARTS', 266.31, 'https://produto.mercadolivre.com.br/MLB-1116545168-capacete-peels-mirage-storm-preto-vermelho-lancamento-_JM'], ['MOTOSHRC', 266.31, 'https://produto.mercadolivre.com.br/MLB-1118021626-capacete-peels-mirage-storm-preto-vermelho-lancamento-_JM'], ['WHMOTOS', 266.35, 'https://produto.mercadolivre.com.br/MLB-1030699897-capacete-peels-mirage-storm-preto-e-rosa-feminino-56-58-60-_JM'], ['GALP |
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
# -*- coding: utf-8 -*- | |
import scrapy | |
from netshoes.items import NetshoesItem | |
class NetshoesspiderSpider(scrapy.Spider): | |
name = 'NetshoesSpider' | |
allowed_domains = ['netshoes.com.br'] | |
start_urls = [ | |
'https://www.netshoes.com.br/busca?nsCat=Natural&q=mirage+storm', | |
'https://www.netshoes.com.br/busca?nsCat=Natural&q=mirage+revo', |
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
# -*- coding: utf-8 -*- | |
import scrapy | |
from ponto_frio.items import PontoFrioItem | |
class PontofrioSpider(scrapy.Spider): | |
name = 'PontoFrio' | |
allowed_domains = [] | |
start_urls = ['https://search3.pontofrio.com.br/busca?q=capacete+axxis'] | |
def parse(self, response): |
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
rom selenium import webdriver | |
from bs4 import BeautifulSoup | |
import csv | |
browser = webdriver.Chrome('C:\\Users\\100pau\\workspace\\chromedriver.exe') | |
browser.get('https://www.centauro.com.br/capacete-peels-mirage-storm-preto-e-verde-fosco-m00w4e-mktp.html?cor=34') | |
html = browser.execute_script("return document.getElementsByTagName('html')[0].innerHTML") | |
soup = BeautifulSoup(html, 'html.parser') |
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
%%time | |
#Importing libraries | |
import pandas as pd | |
import json as JSON | |
from json import load | |
import numpy as np | |
import requests | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
import time |
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
C1 = np.random.multivariate_normal(np.array([5, 5]), np.array([[1, 0],[0, 1]]), 500) | |
C2 = np.random.multivariate_normal(np.array([0, 0]), np.array([[1, 0],[0, 1]]), 500) | |
data1 = pd.DataFrame({'X1':C1[:,0],'X2':C1[:,1]}) | |
data1['Class'] = np.full((500, 1), 'C1') | |
data2 = pd.DataFrame({'X1':C2[:,0],'X2':C2[:,1]}) | |
data1['Class'] = np.full((500, 1), 'C2') | |
data = pd.concat([data1, data2], sort=True) |
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
clear all | |
clc | |
x1 = -0.25 + 0.08 * randn(1, 10); | |
x2 = 0.5 + 0.08 * randn(1, 10); | |
C1 = [x1;x2]; | |
x1 = 0.7 + 0.08 * randn(1, 10); | |
x2 = 0.25 + 0.08 * randn(1, 10); | |
C2 = [x1;x2]; |
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 sklearn.datasets import load_wine | |
from sklearn.utils import shuffle | |
import numpy as np | |
from sklearn.model_selection import KFold | |
from sklearn.preprocessing import scale | |
from sklearn import tree | |
from sklearn.metrics import accuracy_score | |
from sklearn.model_selection import cross_val_score | |
from sklearn.metrics import accuracy_score |
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
# For Windows users# Note: <> denotes changes to be made | |
#Create a conda environment | |
conda create --name <environment-name> python=<version:2.7/3.5> | |
#To create a requirements.txt file: | |
conda list #Gives you list of packages used for the environment | |
conda list -e > requirements.txt #Save all the info about packages to your folder |
OlderNewer