Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib2
- from bs4 import BeautifulSoup
- import csv
- pkg = "com.mavdev.focusoutfacebook"
- url = "https://play.google.com/store/apps/details?id=" + pkg
- def get_app_lastupdate(pkg):
- url = "https://play.google.com/store/apps/details?id=" + pkg
- html = urllib2.urlopen(url).read()
- soup = BeautifulSoup(html, 'html.parser')
- appTitle = soup.find("div", {"class": "document-title"}).text
- date = soup.find("div", {"itemprop": "datePublished"})
- downloads = soup.find("div", {"itemprop": "numDownloads"})
- rating_count = soup.find("span",{'class':'rating-count'}).text
- appDict = dict()
- appDict['lastUpdaDate'] = date.text
- appDict['name'] = appTitle
- appDict['downloadCnt'] = downloads.text
- appDict['rating_count'] = rating_count
- return appDict
- lastUpdate = get_app_lastupdate(pkg)
- print lastUpdate['name']
- print lastUpdate['lastUpdaDate']
- print lastUpdate['downloadCnt']
- print lastUpdate['rating_count']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement