Skip to content

Instantly share code, notes, and snippets.

@mxrss
Created February 13, 2014 18:18
Show Gist options
  • Save mxrss/8980716 to your computer and use it in GitHub Desktop.
Save mxrss/8980716 to your computer and use it in GitHub Desktop.
More Screen Scrappiong
$cats = Invoke-RestMethod -uri "http://coupons.staterbros.com/Category/Index"
$coupons = $null
foreach ($cat in $cats){
$catName = [System.Web.HttpUtility]::HtmlEncode($cat.CategoryName)
$couponSet = Invoke-RestMethod -uri "http://coupons.staterbros.com/Coupons/Index?pageSize=$($cat.CategoryCount)&currentPage=1&filter=$($cat.CategoryId)&sort=1&couponType=AllBrands&brandName=AllBrands&_=1392271883366"
$coupons += $couponSet.CouponsGrid | Add-Member -PassThru NoteProperty CouponCategory $catName
}
$coupons | Get-Member
$coupons = $coupons | Select-Object @{name="Name";Expression={[System.Web.HttpUtility]::HtmlEncode($_.Name)}}, @{name="Details";expression={[System.Web.HttpUtility]::HtmlEncode($_.Details)}}, Discount, ImageUrl, Disclaimer, CouponTypeValue, Id, CouponCategory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment