Advertisement
sxiii

AliExpress Price Parsing with Python

Mar 24th, 2017
466
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. # Python program to grab AliExpress price of an item.
  2. # Written by SecurityXIII on 25.03.2017
  3.  
  4. import urllib
  5. from lxml.html import fromstring
  6.  
  7. url = 'https://ru.aliexpress.com/item/6-12Colors-Non-toxic-Crayon-edible-baby-drawing-Supplies-ring-toy-Easy-to-erase-educational-toys/32753968959.html'
  8. id = 'j-sku-discount-price'
  9.  
  10. content = urllib.urlopen(url).read()
  11. doc = fromstring(content)
  12. print doc.get_element_by_id(id).text_content()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement