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 argparse | |
from pprint import pprint | |
from traceback import format_exc | |
import requests | |
import unicodecsv as csv | |
from lxml import html | |
def parse(brand): |
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 lxml import html | |
import requests | |
from time import sleep | |
import json | |
import argparse | |
from collections import OrderedDict | |
from time import sleep | |
def parse(ticker): | |
url = "http://finance.yahoo.com/quote/%s?p=%s"%(ticker,ticker) |
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 lxml import html | |
import requests | |
import unicodecsv as csv | |
import argparse | |
import json | |
def clean(text): | |
if text: | |
return ' '.join(' '.join(text).split()) |
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
{ | |
"_id":"cars", | |
"startUrl":[ | |
"https://www.cars.com/for-sale/searchresults.action/?mdId=22162&mkId=20053&page=1&perPage=20&rd=10&searchSource=GN_REFINEMENT&shippable-dealers-checkbox=true&showMore=false&sort=relevance&stkTypId=28881&trId=24731&trId=24209&yrId=35797618&yrId=36362520&zc=20005&localVehicles=false" | |
], | |
"selectors":[ | |
{ | |
"id":"car_links", | |
"type":"SelectorElementClick", | |
"parentSelectors":[ |
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 lxml import html, etree | |
import datetime | |
import requests | |
import re | |
import os | |
import sys | |
import unicodecsv as csv | |
import argparse | |
import json | |
# from exceptions import ValueError |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import requests | |
import re | |
from time import time | |
import json | |
import argparse | |
def get_store(store): | |
store_name = store['Name'] |
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 pytesseract | |
import sys | |
import argparse | |
try: | |
import Image | |
except ImportError: | |
from PIL import Image | |
from subprocess import check_output | |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Written as part of https://www.scrapehero.com/how-to-scrape-amazon-product-reviews-using-python/ | |
from lxml import html | |
from json import dump,loads | |
from requests import get | |
import json | |
from re import sub | |
from dateutil import parser as dateparser | |
from time import sleep |
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 requests import get | |
from pprint import pprint | |
from json import dump | |
from csv import QUOTE_ALL, DictWriter | |
API_KEY = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' | |
def address_resolver(json): | |
final = {} | |
if json['results']: | |
data = json['results'][0] | |
for item in data['address_components']: |
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 lxml import html | |
import csv | |
import os | |
import requests | |
from exceptions import ValueError | |
from time import sleep | |
from random import randint | |
def parse(url): | |
headers = { |
NewerOlder