Skip to content

Instantly share code, notes, and snippets.

View skpyns's full-sized avatar

skpyns skpyns

View GitHub Profile
@skpyns
skpyns / Cikloberza.py
Last active August 14, 2018 11:28
Fetching a number of ads of used bicycles
import requests, bs4
# Making a request
r = requests.get('https://www.2bike.rs/cikloberza/mali-oglasi/delovi-20/ramovi-i-delovi-za-ram-181/ramovi-21?fl20[]=138&fl12[]=72')
if r.status_code != 200:
raise Exception("Error!")
# Making a soup and locating an object to be retrieved
soup = bs4.BeautifulSoup(r.text, 'lxml')
ads = soup.find('div', {'class': 'total'})