Skip to content

Instantly share code, notes, and snippets.

View juanifioren's full-sized avatar
🇦🇷

Juan Ignacio Fiorentino juanifioren

🇦🇷
View GitHub Profile
@juanifioren
juanifioren / get_stock_news.py
Last active January 31, 2018 17:20
Get stock news by symbol
import cssselect
from lxml import html
import requests
def get_stock_news(symbol):
url = 'https://www.bloomberg.com/quote/{symbol}:US'
r = requests.get(url.format(symbol=symbol))
tree = html.fromstring(r.content)
@juanifioren
juanifioren / get_stock_finantial_data.py
Created January 31, 2018 17:19
Stock Finantial Data From Yahoo
from lxml import html
import requests
def get_stock_finantial_data(symbol):
url = 'https://finance.yahoo.com/quote/{symbol}/'
r = requests.get(url.format(symbol=symbol))
tree = html.fromstring(r.content)
to_search = [
@juanifioren
juanifioren / settings.py
Last active April 13, 2018 17:39
Tox with pytest, coverage, flake8, and django
SECRET_KEY = 'super-secret-key'
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
@juanifioren
juanifioren / models.py
Created November 29, 2019 17:29
Django Countries Choices
from django.utils.translation import gettext_lazy as _
COUNTRIES_CHOICES = [
('AF', _('Afghanistan')), ('AX', _('Åland Islands')), ('AL', _('Albania')),
('DZ', _('Algeria')), ('AS', _('American Samoa')), ('AD', _('Andorra')),
('AO', _('Angola')), ('AI', _('Anguilla')), ('AQ', _('Antarctica')),
('AG', _('Antigua and Barbuda')), ('AR', _('Argentina')), ('AM', _('Armenia')),
('AW', _('Aruba')), ('AU', _('Australia')), ('AT', _('Austria')),
('AZ', _('Azerbaijan')), ('BS', _('Bahamas')), ('BH', _('Bahrain')),
@juanifioren
juanifioren / pagination.html
Created January 21, 2022 18:08
Django pagination
<ul class="pagination mb-0">
{% if page_obj.has_previous %}
<li class="page-item">
<a id="previous-page" class="page-link" href="#" aria-label="Previous">{% trans 'Previous' %}</a>
</li>
{% else %}
<li class="page-item disabled">
<span class="page-link">{% trans 'Previous' %}</span>
</li>
{% endif %}
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
driver = webdriver.Chrome()
# Primero loguearme.
# url = 'https://www.linkedin.com/login/es