Script to scrape property offers from olx.pl and save them to Google Sheet
Report Bug
Β·
Request Feature
- Python
- Requests
- Google Sheet
git clone https://github.com/DEENUU1/job-scraper.git
- Go to Google Console
- Create or choose existing project Tutorial
- Go to Navigation Menu and select APIs & Services and then Credentials
- Click CREATE CREDENTIALS and choose Service Account
- Give some random name and click Done
- Copy e-mail of the created account
- Then click on the pencil button to the left of the trash icon
- Go to Keys and click ADD KEY and then Create new key
- Choose JSON format and then Create
- Rename downloaded file to
credentials.json
and copy it to the main direction of this project (the same directory where main.py is located) - Go back to Google Console and search for Google Seet API
- Enable this API
- Create new Google Sheet
- In Google Sheet click on Share and copy here the email you copied earlier
- Choose access for all people with link and copy this link
- First you need to go to https://www.olx.pl/nieruchomosci/ and choose all filters that you need
- Then click the right mouse button and go to Devtools
- Go to Network tab and refresh the page
- Scroll to the end and go to page 2 (pagination)
- Scroll to the end again and now in the Network tab search for a JSON with url like this "https://www.olx.pl/api/v1/offers/?offset=40&...."
- In my example it looks like this https://www.olx.pl/api/v1/offers?offset=0&limit=40&category_id=15®ion_id=7&city_id=10609&sort_by=created_at%3Adesc&filter_enum_furniture%5B0%5D=yes&filter_float_price%3Ato=3000&filter_refiners=spell_checker&sl=18c34ade124x23bc10a5
- Then click links and go to previous
cp .env_example .env
OLX_URL
more about it in this section -HOW TO GET OLX URL
GOOGLE_SHEET_URL
url to Google Sheet file
python3 -m venv .venv
venv\Scripts\activate
python main.py
# On windows you can run `run.ps1` powershell script
See LICENSE.txt
for more information.