-
-
Save masahitojp/3233905 to your computer and use it in GitHub Desktop.
Amazonで本のSalesRankのみ抜き出すjQueryスクリプト
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 urllib2 | |
| url = "http://www.amazon.co.jp/o/ASIN/4774152439/book042-22/ref=nosim" | |
| opener = urllib2.build_opener() | |
| opener.addheaders = [('User-agent', 'mozilla 3.6')] | |
| txt = opener.open(url).read() | |
| print(txt) |
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
| var text = jQuery("#SalesRank").text() | |
| text = jQuery.trim(text) | |
| var rank = text.match(/\d+/g) | |
| console.log(rank.join()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment