Advertisement
Embry0

Untitled

Jan 27th, 2020
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. import requests
  2. import lxml.html
  3.  
  4. html = requests.get('https://www.olx.bg/ad/snoubord-s-obuvki-burton-CID618-ID7H6ce.html#a07a6ba667')
  5. doc = lxml.html.fromstring(html.content)
  6.  
  7. if not html.status_code == 200:
  8.     exit()
  9.  
  10. offer_results = doc.xpath('//div[@id="offerdescription"]')
  11. print(offer_results)
  12.  
  13. offer_title = offer_results.xpath('.//div[@class="offer-titlebox"]/text()')
  14. print(offer_title)
  15.  
  16. offer_title_img = offer_results.xpath('.//div[@class="photo-gallery-opener"]')
  17. print(offer_title_img)
  18.  
  19. offer_location = offer_results.xpath('.//a[@class="snow-map-link"]/text()')
  20. print(offer_location)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement