This file contains hidden or 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 | |
| import re | |
| from urllib.parse import urlparse, parse_qs | |
| class CinemaSpider(scrapy.Spider): | |
| name = 'cinema' | |
| def start_requests(self): |
This file contains hidden or 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
| <div class="row text-center"> | |
| <div class="col-lg-12"> | |
| <ul class="pagination"> | |
| {% if page_obj.has_previous %} | |
| <li class="page-item"><a class="page-link" href="?page={{ page_obj.previous_page_number }}{% if request.GET.q %}&q={{ request.GET.q }}{% endif %}">«</a></li> | |
| {% endif %} | |
| {% for pg in page_obj.paginator.page_range %} | |
| <!-- Sempre mostra as 3 primeiras e 3 últimas páginas --> | |
| {% if pg == 1 or pg == 2 or pg == 3 or pg == page_obj.paginator.num_pages or pg == page_obj.paginator.num_pages|add:'-1' or pg == page_obj.paginator.num_pages|add:'-2' %} |
This file contains hidden or 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
| <q-select dense bottom-slots stack-label | |
| class="q-mt-xl" | |
| style="max-width: 600px" | |
| v-model="selectedclient" | |
| use-input | |
| input-debounce="0" | |
| @change="changeClient($event)" | |
| :options="options" | |
| @filter="filterFn" | |
| behavior="menu" |
This file contains hidden or 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
| def gastosPorMesView(request): | |
| template = "website/gastosPorMes.html" | |
| qs = Gasto.objects.all() # Use the Pandas Manager | |
| if request.method == 'POST': | |
| request.POST.get('dtInicial') | |
| df = qs.filter(comercio_id=1) \ | |
| .to_dataframe(['id', 'name', 'comercio_id', 'datagasto', 'valor'], index='datagasto') | |
| """Format the column headers for the Bootstrap table, | |
| they're just a list of field names, | |
| duplicated and turned into dicts like this: {'field': 'foo', 'title: 'foo'} |
This file contains hidden or 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
| <form action="#" method="POST" class="form-inline"> | |
| <div class="input-group mb-3"> | |
| <div class="input-group-prepend"> | |
| <label class="input-group-text" for="inputGroupSelect01">Tipos</label> | |
| </div> | |
| <select name="comercio_id" class="custom-select" id="inputGroupSelect01"> | |
| <option selected>Escolha...</option> | |
| {% for comercio in comercios %} | |
| <option value="{{ comercio.id }}">{{ comercio.name }}</option> | |
| {% endfor %} |
This file contains hidden or 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 pandas as pd | |
| from bs4 import BeautifulSoup | |
| import win32com.client as win32 | |
| from requests import get | |
| import lxml.html | |
| from pprint import pprint | |
| url = 'https://valor.globo.com/' | |
| # html = urlopen(url) | |
| response = get(url) |
This file contains hidden or 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 bs4 import BeautifulSoup | |
| import requests | |
| from collections import OrderedDict | |
| def importa(url, tmout=2): | |
| page = requests.get(url=url, timeout=tmout) | |
| soup = BeautifulSoup(page.content, 'html.parser') | |
| #print('\nsoup >>>', soup) | |
| table = soup.find_all(id="countries")[0] | |
| result = [] |
This file contains hidden or 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.by import By | |
| from selenium.webdriver.support.ui import WebDriverWait | |
| from selenium.webdriver.support import expected_conditions as CondicaoExperada | |
| from selenium.common.exceptions import * | |
| from selenium.webdriver import ActionChains | |
| from selenium.webdriver.common.keys import Keys | |
| from time import sleep | |
| import os, random |
This file contains hidden or 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 requests import get | |
| import lxml.html | |
| url_iphone = 'https://www.amazon.com.br/s?k=iphone&__mk_pt_BR=%C3%85M%C3%85%C5%BD%C3%95%C3%91&ref=nb_sb_noss_2' | |
| xpath_box = "//div[@class='a-section a-spacing-medium']" | |
| xpaht_search = '//*[@id="twotabsearchtextbox"]' | |
| xpath_name_product = '//div/h2/a/span' | |
| xpath_price_product = "//span[@class='a-offscreen']" | |
| # xpath_price_product = "//span[@data-a-color='base']" |
This file contains hidden or 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 python:3.6.10 | |
| ENV PYTHONDONTWRITEBYTECODE 1 | |
| ENV PYTHONUNBUFFERED 1 | |
| RUN mkdir /code | |
| WORKDIR /code | |
| RUN pip install --upgrade pip | |
| COPY requirements/ /code/requirements/ | |
| RUN pip install -r requirements/dev.txt |