Skip to content

Instantly share code, notes, and snippets.

@XiaoyuShan
XiaoyuShan / headless_info.js
Created April 19, 2013 19:57
Using headless browser to load web page, get image info given image url and get price info given class name.
var casper = require('casper').create({
clientScripts: ["jquery.min.js","svpply.js","svpply2.js","buy_later_tool_kit"],
verbose: true,
viewportSize: {width: 1800, height: 1400}
});
var dump = require("utils").dump;
var url = 'http://www.manufactum.com/shirts-tops-c193634/'
var imgurl = 'http://images.manufactum.de/manufactum/thumbs_188/72612_1.jpg'
var fs = require('fs');
@XiaoyuShan
XiaoyuShan / Main.py
Last active December 16, 2015 10:49
These are different methods run in Main.py to get the right price by finding closest xpath distance
from get_price_test import get_price
from imagexpath_get import xpath_imgrequest
from xpath_compare import xpath_compare
from get_price_test import price_get
from get_price_test import currency_get
weburl2 = "http://www.manufactum.com/sweaters-c193633/"
imgurl2 = "http://images.manufactum.de/manufactum/thumbs_188/84498_1.jpg"