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 lxml import html | |
| import requests | |
| # Set the number of pages to scrap | |
| PAGES_TO_SCRAP = 15 | |
| # Base URL for the seach results. | |
| BASE_PAGE = 'http://www.wegottickets.com/searchresults/page/' | |
| # XPATH selector for the event links | |
| EVENT_LINK_SELECTOR = '//a[@class="event_link"]' |
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
| #!/usr/bin/env python | |
| import xml.etree.ElementTree as ET | |
| import os | |
| import urllib, urllib2 | |
| # Get the HTML | |
| response = urllib2.urlopen('http://www.cuartopoder.es/multimedia/2014/10/11/gastos-de-los-exdirectivos-de-caja-madrid-uno-a-uno-con-las-tarjetas-negras-tabla/3403') | |
| html = response.read() | |
| # Parse the HTML looking for the links |
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
| <!DOCTYPE html> | |
| <meta charset="utf-8"> | |
| <style> | |
| span, strong { | |
| font-family: "Helvetica Neue", Helvetica, Arial; | |
| font-size: 14px; | |
| } | |
| text { |
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
| <!DOCTYPE html> | |
| <meta charset="utf-8"> | |
| <style> | |
| body { | |
| font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; | |
| margin: auto; | |
| position: relative; | |
| width: 960px; | |
| } |
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
| #!/usr/bin/env python | |
| import os, sys, json | |
| def get_dir_size(base_dir): | |
| total_size = 0 | |
| for dirpath, dirnames, filenames in os.walk(base_dir): | |
| if '/.' in dirpath: | |
| continue | |
| for f in filenames: |
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
| #!/usr/bin/env python | |
| import time | |
| import requests | |
| import xmltodict | |
| import sys | |
| from lxml import etree | |
| BASE_URL = 'http://thepiratebay.si/search/' |
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
| #!/usr/bin/env python | |
| from os.path import expanduser | |
| from itertools import groupby | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| from numpy import arange | |
| def plotTagValues(data,tag): | |
| labels = data.keys() |