Advertisement
sxiii

AliExpress Price Parsing with Bash & wget (Linux)

Mar 24th, 2017
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.52 KB | None | 0 0
  1. #!/bin/bash
  2. # The following script parses aliexpress product's price with bash.
  3. # Required: wget; cat; grep; awk (everything except wget should be installed by default)
  4. # The following scripts takes URL of a product.
  5. # Run like: ./script.sh "https://ru.aliexpress.com/item/SAMSUNG-USB-Flash-Drive-Disk16G-32G-64G-128-USB-3-0-Metal-Super-Mini-Pen-Drive/32595548093.html"
  6.  
  7. echo "The price of the item is:"
  8. wget -O a.html -q "$1"; cat a.html | grep j-sku-price | awk -F">" '{ print $2 }' | awk -F"<" '{ print $1 }'
  9. rm a.html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement