Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import lxml.html
- html = requests.get('https://www.olx.bg/ad/snoubord-s-obuvki-burton-CID618-ID7H6ce.html#a07a6ba667')
- doc = lxml.html.fromstring(html.content)
- if not html.status_code == 200:
- exit()
- offer_results = doc.xpath('//div[@id="offerdescription"]')
- print(offer_results)
- offer_title = offer_results.xpath('.//div[@class="offer-titlebox"]/text()')
- print(offer_title)
- offer_title_img = offer_results.xpath('.//div[@class="photo-gallery-opener"]')
- print(offer_title_img)
- offer_location = offer_results.xpath('.//a[@class="snow-map-link"]/text()')
- print(offer_location)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement