An Ozon parser is a program that opens product pages on the marketplace, reads the data you need and puts it into a table. In this guide you'll build such a parser for Ozon from scratch: collect prices, stock levels and reviews across your product list, connect mobile proxies so collection runs smoothly, and set up automatic scheduled runs. No theory for theory's sake — just what you need to get results.

Introduction: what you'll get and who this guide is for

By the end of this tutorial you'll have your own Ozon parser running on your computer that takes a list of links or SKUs and collects three groups of data: the current price (including the Ozon Card price and the non-discounted price), an in-stock flag and warehouse stock level, plus reviews with rating, date and text. Results are saved to a CSV file and a SQLite database, and if you want, the whole thing runs daily without your involvement.

This guide doesn't overlap with our article on proxies for the seller cabinet: that one covered safe work with a seller's personal account and multi-accounting. Here the task is different — collecting public data from the storefront for analytics: competitor monitoring, checking your own prices, tracking reviews.

Who this guide is for

  • Sellers and marketplace managers who want to see competitors' prices in a table instead of opening product pages by hand.
  • Marketers and analysts who need reviews for analysis: what people praise, what they complain about, how the rating changes.
  • Beginner developers who want to learn scraping on a real example.
  • Owners of small stores who want to automatically check supplier stock on Ozon.

What you need to know in advance

No special knowledge required. It's enough to be able to install programs, open a command line and copy text. If you've run a Python script even once, it'll be a breeze. All commands and code in the guide are given in full — you just need to repeat them. For advanced readers there are separate sections with optimization ideas.

How much time it takes

Setting up the environment and the first runs take one relaxed evening. If you're already familiar with Python, you'll build your first price table faster. Reviews and scheduling are another session the next day. Don't rush: it's better to go through each step with a check than to hunt for what broke later.

Preparation: tools, access, requirements

Before writing an Ozon parser, you need to prepare your workspace. Below is the full list of what you'll need and what to install.

System requirements

  • A computer with Windows, macOS or Linux. A regular laptop or a virtual server will do.
  • A stable internet connection. For the first runs, a home connection is enough.
  • Free disk space for the automation browser — it takes a few hundred megabytes.
  • Permission to install programs.

What to install

  1. Python version 3.12 or newer. This is the language we write the parser in.
  2. A code editor. We recommend Visual Studio Code — it's free and shows errors right in the program text.
  3. The Playwright library — it controls a browser without a visible window and lets you open Ozon pages just like a human does.
  4. The requests and pandas libraries — the first for simple HTTP requests (e.g., for the IP change command), the second for working with tables.
  5. The Chrome or Edge browser for manually inspecting the page via developer tools.

Access

  • A list of products you want to track: links to product pages or Ozon SKUs. Start with a small list — it's easier to debug.
  • Access to mobile proxies. For one-off manual runs over a few product pages they aren't necessary, but for regular monitoring of hundreds of items, collection quickly hits anti-bot checks without them. In this guide we use MobileProxy.Space mobile proxies — they have everything a parser needs: IP changes by timer or by link, and separate HTTP and SOCKS5 ports.

Backups

The parser doesn't change anything on Ozon — it only reads. So backups concern only your data: create a separate project folder and after each successful step copy the script file under a new name, e.g. parser_v1.py, parser_v2.py. That way you can always go back to a working version.

Note: collect only public data that any storefront visitor sees, and don't try to access closed sections, other people's accounts or buyers' personal data. Reviewer names and photos are personal data, and storing them in your database without a legal basis isn't allowed. In this guide we save only the rating, date and text of a review.

Basic concepts: how an Ozon page works and what scraping is

So you're not taking steps blindly, let's go over a few terms. All explanations — in plain language.

Key terms

  • Scraping — automatically extracting data from a page. A human reads a product page with their eyes; a parser reads its code and pulls the price from the right spot.
  • HTML — the page code that the browser turns into a picture with buttons and text. The price, title, stock — it's all somewhere inside the HTML.
  • Headless browser — a regular browser that works without a window. It loads the page fully, runs scripts and gives the parser a ready result. This matters for Ozon: the storefront assembles the product page from many blocks using JavaScript, and a plain request for HTML often returns an empty skeleton without data.
  • Selector — the address of an element inside the page. For example, a selector says: find the price block inside the product description block.
  • JSON — a data format of nested key–value pairs. Many Ozon pages have service JSON blocks from which it's easier to take the price than from visual elements.
  • SKU — the numeric product identifier in the product page address. It's at the end of the link after the hyphen. It's handy for storing price history.
  • Proxy — an intermediary server through which your parser's requests go. The site sees the proxy's address, not your computer's.
  • Mobile proxies — proxies running through cellular carrier SIM cards. Their addresses belong to mobile operators and change constantly, like those of regular subscribers.
  • IP rotation — a scheduled change of the address on a proxy port. It's done by timer (every N seconds) or by command — following a special link.

Core principles of how a parser works

Any Ozon parser does the same thing in a loop: takes the next link from the list, opens it via a browser or HTTP request, waits for it to load, extracts the needed fields, writes them to a table, pauses and moves to the next link. Everything else is convenience: proxies, retries on errors, scheduling, notifications.

What's important to understand before you start

First: Ozon pages change often. Layout and internal data formats get updated, so selectors that work today may stop working in a month. A good parser is built so that replacing a selector takes a minute. We'll build that into the code structure.

Second: the marketplace protects its storefront from overload. If many fast identical requests come from one address, the site shows a check or temporarily restricts access. So the parser must behave carefully: pause, avoid opening hundreds of pages per second and spread the load across addresses. This isn't about being clever — it's about correct behavior: you're imposing load comparable to one or two regular visitors.

Third: if you need stock and prices only for your own products, remember that Ozon has an official seller API. For your own items that's the right and reliable path. A parser is needed where there's no official access — for competitor product pages and general storefront analytics.

Step 1: Install Python and the parser environment

Goal of this stage: get a ready environment where the code runs, and make sure the automation browser is installed.

  1. Open the official Python website, download the installer for your system. On Windows, during installation be sure to check Add python.exe to PATH — it's at the bottom of the first installer screen. Without it, the python command won't work in the console.
  2. Install Visual Studio Code. After installation, open it and via the File — Open Folder menu create a project folder, e.g. ozon_parser.
  3. Open the terminal inside the editor: Terminal — New Terminal menu. A command-line window will appear at the bottom, already opened in the project folder.
  4. Create a virtual environment — a separate sandbox for libraries so they don't conflict with other projects. Enter the command: python -m venv venv and press Enter. A venv directory will appear in the folder.
  5. Activate the environment. On Windows: venv\Scripts\activate. On macOS and Linux: source venv/bin/activate. The terminal line will start with (venv).
  6. Install the libraries with one command: pip install playwright requests pandas. Wait for the Successfully installed message.
  7. Install the browser for Playwright: playwright install chromium. The download takes some time — don't close the terminal.
  8. Create a check.py file in the project folder with the line print('Окружение готово') and run it with python check.py.

Tip: if the python command isn't found on Windows, try typing py instead of python. This is an alternative launcher installed together with the interpreter.

Check: the terminal shows the text Окружение готово, and the playwright --version command outputs a version number. That means Python, the libraries and the browser are installed correctly.

Possible issues

  • "Running scripts is disabled" error on Windows when activating venv. Open PowerShell as administrator and run Set-ExecutionPolicy RemoteSigned, then repeat activation.
  • pip complains about permissions. Make sure the environment is activated — the terminal line should show (venv).
  • playwright install fails with a network error. Repeat the command later or check if your antivirus is blocking the download.

Step 2: Study the product page and find where the data lives

Goal of this stage: understand where to get the price, stock and reviews from, and write down the selectors that your Ozon parser will use.

Many people skip this step and then wonder why the code returns nothing. Don't skip it: ten minutes here save hours of debugging.

  1. Open any Ozon product page in Chrome. Look at the address bar: at the end of the link there's a number after the hyphen — that's the SKU. Write it down, you'll need it for the test.
  2. Press F12 — developer tools will open. Go to the Elements tab.
  3. Click the arrow icon in the top-left corner of the panel (or Ctrl+Shift+C) and click the product price on the page. The panel will highlight the element with the price. Notice the structure: the price usually sits in a block with a data-widget attribute named something like webPrice. Such attributes are more stable than classes with chaotic names — classes change with every site build, while widget names live longer.
  4. In the same way, click the availability block. If the product is running out, a note about the number of units appears next to the add-to-cart button. If the product is out of stock, the button changes to "Узнать о поступлении" or similar. Write down what both states look like — they'll become our stock indicators.
  5. Scroll down to the reviews. Note that reviews load as you scroll, and the block has its own widget with a name containing the word review. Write it down.
  6. Now let's look for a more convenient source — structured data. In the Elements panel press Ctrl+F and type ld+json. You'll find a script tag with the application/ld+json type. Inside is JSON describing the product: title, SKU, price in the offers field, availability status. This is a standard format for search engines, and it's convenient to use as a primary source.
  7. Go to the Network tab, set the Fetch/XHR filter and reload the page. You'll see internal requests with which the storefront assembles the product page. Among them are requests returning JSON with the same blocks — price, stock, reviews. Click any of them and look at the Response tab. Write down which field names appear: this will come in handy if you want to move to an advanced collection method.

Note: internal requests are not a public API. Their format can change without warning, and you have no guarantees. In the basic parser version we rely on the rendered page and JSON-LD, and we leave internal requests for the advanced section.

Tip: make a selectors.txt file in the project folder and write down all the addresses you find: the price widget, the reviews widget, the availability indicators. When Ozon updates the layout, you'll update this file instead of searching through all the code.

Check: you've found the price block on the page and its data-widget attribute, found the ld+json tag with the offers field, and know what the availability block looks like in two states — in stock and out of stock.

Possible issues

  • There's no ld+json on the page. This happens in some categories. Then the parser will take the price from the widget, and JSON-LD is just an additional source when it's there.
  • The price is shown with a different discount depending on region. The storefront determines the region by address and settings. To keep data comparable, fix the region in the parser settings — more on this in step 4.

Step 3: Connect mobile proxies and set up IP rotation

Goal of this stage: get a working proxy address, test it from Python and choose the IP change mode that suits scraping.

Why does a parser need a proxy if it behaves carefully? It's about scale. Even a polite parser going through hundreds of product pages in a row looks, from the site's point of view, like one address with an abnormally long session. A home or server address with such a profile gets checks faster. Mobile proxies run through cellular carrier SIM cards: thousands of regular subscribers go online from their addresses at the same time, addresses change regularly, and the load profile is spread naturally. For collecting public data this is the calmest option.

How a proxy port works in MobileProxy.Space

After you arrange access you get: the server address, port number, login and password. An important feature: the same port is available over two protocols. As of 22.09.2026, the SOCKS5 port equals the HTTP port plus one. So if you were given HTTP port 10000, then SOCKS5 will be on port 10001. For Playwright HTTP is more convenient, for some libraries SOCKS5 — choose whichever is easier to integrate.

IP changes on the port are configured in two ways (as of 22.09.2026): by timer — the address changes automatically after a set interval, and by link or API — the address changes the moment you make a request to a special URL. Both modes are useful to a parser: the timer for background collection without extra logic, the link when you need to change the address right before a problematic product page.

How fast is it? As of 14.11.2026, the average duration of an IP change from command to new address is 4.56 s, and 80.8% of changes complete within 5 seconds. For a parser this means a simple thing: after requesting an address change it's enough to wait a few seconds — and you can continue working. The scale of the network also matters: as of 14.11.2026, there are 2,196,242 IP changes across the network per day, and IPs were changed by 8,795 modems and 7,924 proxy ports. The median number of unique IPs per modem per day is 95. In other words, one port goes through many addresses in a day, and your parser doesn't "sit" on one.

Step-by-step setup

  1. Log in to your MobileProxy.Space account and open the card for your proxy. Copy four values into a config.py file: host, HTTP port, login, password.
  2. In the same card find the IP change link — this is the URL whose visit replaces the address on the port. Copy it into config.py under the name ROTATE_URL.
  3. Choose the rotation mode. For starters, enable timer-based changes. Which interval? As of 14.11.2026, the median interval between timer changes across the network is 120 s, and 78.1% of timer intervals are exactly divisible by one minute — that is, most users set round values in minutes. For background price monitoring this is a reasonable starting point; you'll later tune the interval to your collection speed.
  4. Create a config.py file with the following content:
PROXY_HOST = 'адрес_из_кабинета'
PROXY_PORT = 10000
PROXY_USER = 'логин'
PROXY_PASS = 'пароль'
ROTATE_URL = 'ссылка_смены_ip_из_кабинета'
PROXY_URL = f'http://{PROXY_USER}:{PROXY_PASS}@{PROXY_HOST}:{PROXY_PORT}'
  1. Test the proxy from Python. Create a check_proxy.py file:
import requests, time
from config import PROXY_URL, ROTATE_URL
proxies = {'http': PROXY_URL, 'https': PROXY_URL}
ip1 = requests.get('https://api.ipify.org', proxies=proxies, timeout=30).text
print('Текущий IP:', ip1)
requests.get(ROTATE_URL, timeout=30)
time.sleep(6)
ip2 = requests.get('https://api.ipify.org', proxies=proxies, timeout=30).text
print('IP после смены:', ip2)
  1. Run: python check_proxy.py. You'll see two addresses. If they differ, rotation by link works.

Tip: don't hit the IP change link several times in a row within one or two seconds. As of 14.11.2026, the share of duplicate change records by link with an interval of no more than two seconds and the same IP is 1.2% — these are exactly the cases where the command was sent again before the previous one finished. You sent the request — wait a few seconds — then work on.

Check: the check_proxy.py script outputs an address, and after the change — a different address. If the addresses match, wait a few more seconds and repeat: the change may not have finished yet.

Possible issues

  • 407 Proxy Authentication Required error. Wrong login or password. Check that you copied them without spaces.
  • Connection timeout. Check the host and port. Remember the correspondence: if you specified the SOCKS5 port in HTTP settings, the connection won't happen — the HTTP port is one less (as of 22.09.2026).
  • The address doesn't change after the link. Make sure you copied the whole link and wait a bit longer: some changes take more than five seconds.

Step 4: Write the price and stock collection

Goal of this stage: get a script that, for a list of links, opens product pages via a headless browser with a proxy and returns the price, old price, Ozon Card price and an in-stock flag with stock level.

  1. Create a products.txt file and paste links to product pages into it — one per line. Start with a few.
  2. Create a parser_prices.py file. Paste the code below in full. It's split into functions: open the page, extract JSON-LD, extract the price from the widget, determine availability. This structure lets you fix one function at a time when Ozon changes its layout.
import json, re, time, random, csv
from datetime import datetime
from playwright.sync_api import sync_playwright
from config import PROXY_HOST, PROXY_PORT, PROXY_USER, PROXY_PASS

PAUSE_MIN, PAUSE_MAX = 3, 7

def read_links(path='products.txt'):
with open(path, encoding='utf-8') as f:
return [l.strip() for l in f if l.strip()]

def sku_from_url(url):
m = re.search(r'-(\d+)/?(\?|$)', url)
return m.group(1) if m else ''

def digits(text):
found = re.sub(r'[^0-9]', '', text or '')
return int(found) if found else None

def parse_ldjson(page):
data = {}
for el in page.query_selector_all('script[type="application/ld+json"]'):
try:
obj = json.loads(el.inner_text())
except Exception:
continue
if isinstance(obj, dict) and obj.get('@type') == 'Product':
data['name'] = obj.get('name')
offers = obj.get('offers') or {}
if isinstance(offers, list):
offers = offers[0] if offers else {}
data['ld_price'] = offers.get('price')
data['ld_availability'] = offers.get('availability')
return data

def parse_price_widget(page):
result = {'price': None, 'old_price': None, 'card_price': None}
box = page.query_selector('[data-widget="webPrice"]')
if not box:
return result
text = box.inner_text()
nums = [digits(t) for t in re.findall(r'[0-9][0-9 ]*[0-9]', text)]
nums = [n for n in nums if n]
if 'Ozon Карт' in text and nums:
result['card_price'] = nums[0]
nums = nums[1:]
if nums:
result['price'] = nums[0]
if len(nums) > 1:
result['old_price'] = nums[1]
return result

def parse_stock(page):
body = page.inner_text('body')
if 'Узнать о поступлении' in body or 'Этот товар закончился' in body:
return {'in_stock': False, 'stock_left': 0}
m = re.search(r'Осталось ([0-9]+) шт', body)
return {'in_stock': True, 'stock_left': int(m.group(1)) if m else None}

def collect(url, context):
page = context.new_page()
page.goto(url, wait_until='domcontentloaded', timeout=60000)
page.wait_for_selector('[data-widget="webPrice"], [data-widget="webOutOfStock"]', timeout=30000)
row = {'sku': sku_from_url(url), 'url': url, 'ts': datetime.now().isoformat(timespec='seconds')}
row.update(parse_ldjson(page))
row.update(parse_price_widget(page))
row.update(parse_stock(page))
page.close()
return row

def main():
links = read_links()
rows = []
with sync_playwright() as p:
browser = p.chromium.launch(headless=True, proxy={
'server': f'http://{PROXY_HOST}:{PROXY_PORT}',
'username': PROXY_USER, 'password': PROXY_PASS})
context = browser.new_context(locale='ru-RU', viewport={'width': 1366, 'height': 900})
for url in links:
try:
row = collect(url, context)
print(row['sku'], row.get('price'), row.get('in_stock'), row.get('stock_left'))
rows.append(row)
except Exception as e:
print('Ошибка на', url, '-', repr(e))
time.sleep(random.uniform(PAUSE_MIN, PAUSE_MAX))
browser.close()
if rows:
keys = sorted({k for r in rows for k in r})
with open('prices.csv', 'a', newline='', encoding='utf-8-sig') as f:
w = csv.DictWriter(f, fieldnames=keys)
if f.tell() == 0:
w.writeheader()
w.writerows(rows)

if __name__ == '__main__':
main()
  1. Run: python parser_prices.py. The script will print the SKU, price and availability for each link.
  2. Open the prices.csv file in Excel or LibreOffice. It will have the columns sku, url, ts, name, ld_price, price, old_price, card_price, in_stock, stock_left.

What each part of the code does

  • read_links reads links from the file, skipping empty lines.
  • sku_from_url pulls the SKU from the end of the link — you'll use it later to combine history.
  • parse_ldjson looks for structured data and takes the title, price and availability status from there. This is the primary source: it's more resistant to layout changes.
  • parse_price_widget reads the text of the price block and extracts numbers. The first number is usually the Ozon Card price if it's highlighted, then the main price and the crossed-out old one.
  • parse_stock looks at the indicators: the out-of-stock note or the "Осталось N шт" label. If the product is in stock but the exact number isn't shown, the stock_left field will be empty — that's normal, Ozon shows the stock level only when it's low.
  • collect opens the page, waits for the price widget or the "out of stock" widget to appear and collects everything together.
  • main launches the browser with the proxy, goes through the list with random pauses and appends the results to CSV.

Note: don't reduce the pauses to zero and don't run multiple copies of the script on one proxy port. The "as fast as possible" mode is the main reason the storefront starts showing checks. A random pause of a few seconds between product pages makes behavior look like a regular user and reduces load on the site.

Tip: do your first two or three runs with the headless=False parameter. You'll see the browser window and what happens in it: how the product page loads, whether a check appears, whether the script is looking for the price in the right place. This is the fastest way to understand what's going wrong.

Check: in prices.csv, for each link sku, price and in_stock are filled in, and the values match what you see on the product page in the browser. If the Ozon Card price is on the page, the card_price field is filled in and less than the price field.

Possible issues

  • The script waits and fails on a wait_for_selector timeout. Either the widget name changed — check via F12 and fix it in the code, or a check page opened instead of the product page. In the second case, increase the pauses and change the IP by link before retrying.
  • The wrong price is extracted. Look at what's in the widget text: add print(text) in parse_price_widget. Sometimes the order of numbers differs, e.g. when there's no card price. Compare with ld_price — it usually contains the main price.
  • The region is wrong. Price and availability depend on the delivery region. Set the city in the browser context: open any product page with headless=False, select the city manually, save the context state via context.storage_state(path='state.json') and in subsequent runs create the context with the storage_state='state.json' parameter.

Step 5: Collect reviews

Goal of this stage: for each product, get a list of reviews with rating, date, text, pros and cons, without saving reviewers' personal data.

Ozon reviews live on a separate page of the product page: reviews is added to the product address. There, reviews load in batches as you scroll. The most reliable way for beginners is to scroll the page in a headless browser and collect review cards as they appear.

  1. Open the product page in Chrome again, go to the reviews section, press F12 and use the selection arrow to click one review. Find the review's common container and inside it: the star block (usually a set of svg icons where filled ones differ in style), the date, the text, the "Достоинства" and "Недостатки" labels. Write down the reviews widget in selectors.txt — its data-widget attribute contains the word review.
  2. Create a parser_reviews.py file:
import re, time, random, csv
from datetime import datetime
from playwright.sync_api import sync_playwright
from config import PROXY_HOST, PROXY_PORT, PROXY_USER, PROXY_PASS

MAX_SCROLLS = 15

def reviews_url(url):
base = url.split('?')[0].rstrip('/')
return base + '/reviews/'

def parse_review_block(text):
row = {'rating': None, 'date': None, 'pros': '', 'cons': '', 'text': ''}
m = re.search(r'([0-9]{1,2} [а-яА-Я]+ [0-9]{4})', text)
if m:
row['date'] = m.group(1)
parts = re.split(r'(Достоинства|Недостатки|Комментарий)', text)
current = 'text'
for part in parts:
if part == 'Достоинства':
current = 'pros'
elif part == 'Недостатки':
current = 'cons'
elif part == 'Комментарий':
current = 'text'
else:
if current in ('pros', 'cons', 'text') and part.strip():
row[current] = (row[current] + ' ' + part.strip()).strip()
return row

def collect_reviews(url, context, sku):
page = context.new_page()
page.goto(reviews_url(url), wait_until='domcontentloaded', timeout=60000)
page.wait_for_selector('[data-widget*="webListReviews"], [data-widget*="webReview"]', timeout=30000)
seen = set()
rows = []
for _ in range(MAX_SCROLLS):
blocks = page.query_selector_all('[data-widget*="Review"] [data-review-uuid], [data-widget*="Review"] > div > div')
for b in blocks:
text = b.inner_text()
key = hash(text)
if key in seen or len(text) < 20:
continue
seen.add(key)
row = parse_review_block(text)
stars = b.query_selector_all('svg')
filled = [s for s in stars if 'rgb(255, 165, 0)' in (s.get_attribute('style') or '')]
row['rating'] = len(filled) if filled else None
row['sku'] = sku
row['collected_at'] = datetime.now().isoformat(timespec='seconds')
rows.append(row)
page.mouse.wheel(0, 2500)
time.sleep(random.uniform(1.5, 3))
page.close()
return rows

def main():
links = [l.strip() for l in open('products.txt', encoding='utf-8') if l.strip()]
all_rows = []
with sync_playwright() as p:
browser = p.chromium.launch(headless=True, proxy={
'server': f'http://{PROXY_HOST}:{PROXY_PORT}',
'username': PROXY_USER, 'password': PROXY_PASS})
context = browser.new_context(locale='ru-RU')
for url in links:
sku = re.search(r'-(\d+)/?', url)
sku = sku.group(1) if sku else ''
try:
rows = collect_reviews(url, context, sku)
print(sku, 'отзывов собрано:', len(rows))
all_rows.extend(rows)
except Exception as e:
print('Ошибка на', url, '-', repr(e))
time.sleep(random.uniform(4, 9))
browser.close()
if all_rows:
keys = ['sku', 'rating', 'date', 'pros', 'cons', 'text', 'collected_at']
with open('reviews.csv', 'a', newline='', encoding='utf-8-sig') as f:
w = csv.DictWriter(f, fieldnames=keys, extrasaction='ignore')
if f.tell() == 0:
w.writeheader()
w.writerows(all_rows)

if __name__ == '__main__':
main()
  1. Run python parser_reviews.py. The console will show the number of reviews collected for each SKU.
  2. Open reviews.csv. Check that the rating, date and text match what's visible on the page.

How it works

  • reviews_url turns the product page link into the reviews section link.
  • parse_review_block parses the text of a single review: looks for the date and splits the text by the "Достоинства", "Недостатки", "Комментарий" labels.
  • collect_reviews scrolls the page the specified number of times, collects new blocks each time and remembers already processed ones to avoid duplicates.
  • The rating is counted by the number of filled stars. The fill indicator in the code is the color in the icon's inline style; if Ozon changes the rendering method, update this check by looking at the star style via F12.

Note: the code deliberately doesn't collect the author's name, photo and profile link. This data is personal, and processing it without a legal basis isn't allowed. For sentiment and topic analysis of reviews, the rating, date and text are enough. Don't add fields with names "just in case" to the parser.

Tip: don't collect all reviews every day. On the first run, collect the history, then increase MAX_SCROLLS only for new items, and for old ones go through the first screens: new reviews appear at the top when sorted by date. This reduces load and collection time.

Check: reviews.csv has rows with filled sku, rating and text; the number of rows roughly matches the number of reviews you see when manually scrolling the same number of screens.

Possible issues

  • Duplicates are collected. Increase the text length threshold or add the date and the first characters of the text to the deduplication key.
  • The rating is always empty. The star color in the style changed. Open F12, look at the style of a filled star and update the line with the color check.
  • New reviews don't load when scrolling. Increase the pause between scrolls: a batch of reviews arrives with a delay, and the parser scrolls further before it arrives.

Step 6: Save history to a database, add IP changes and retries

Goal of this stage: move from one-off CSV to an accumulating database with price history, teach the Ozon parser to change the address automatically and retry failed product pages.

SQLite database

CSV is convenient for a first look, but history needs a database. SQLite is built into Python and doesn't require a server install — the database lives in one file.

  1. Create a storage.py file:
import sqlite3

def get_db(path='ozon.db'):
db = sqlite3.connect(path)
db.execute('CREATE TABLE IF NOT EXISTS prices (sku TEXT, ts TEXT, name TEXT, price INTEGER, old_price INTEGER, card_price INTEGER, in_stock INTEGER, stock_left INTEGER, url TEXT)')
db.execute('CREATE TABLE IF NOT EXISTS reviews (sku TEXT, rating INTEGER, date TEXT, pros TEXT, cons TEXT, text TEXT, collected_at TEXT, UNIQUE(sku, date, text))')
db.commit()
return db

def save_price(db, r):
db.execute('INSERT INTO prices VALUES (?,?,?,?,?,?,?,?,?)', (r.get('sku'), r.get('ts'), r.get('name'), r.get('price'), r.get('old_price'), r.get('card_price'), 1 if r.get('in_stock') else 0, r.get('stock_left'), r.get('url')))
db.commit()

def save_review(db, r):
db.execute('INSERT OR IGNORE INTO reviews VALUES (?,?,?,?,?,?,?)', (r.get('sku'), r.get('rating'), r.get('date'), r.get('pros'), r.get('cons'), r.get('text'), r.get('collected_at')))
db.commit()
  1. In parser_prices.py, add from storage import get_db, save_price at the top, create db = get_db() in main before the loop, and after a successful collect call save_price(db, row). The same for reviews: save_review for each row. The UNIQUE constraint in the reviews table will automatically discard repeated reviews on subsequent runs.

Changing IP by link on error

If a product page didn't load or a check appeared instead of it, the right reaction isn't to hammer it with retries from the same address, but to pause, change the address and try again. Add this function to parser_prices.py:

import requests
from config import ROTATE_URL

def rotate_ip():
try:
requests.get(ROTATE_URL, timeout=30)
except Exception as e:
print('Не удалось отправить команду смены IP:', repr(e))
time.sleep(8)

def collect_with_retry(url, context, attempts=3):
for i in range(attempts):
try:
return collect(url, context)
except Exception as e:
print(f'Попытка {i + 1} не удалась:', repr(e))
rotate_ip()
return None

And replace the collect call in main with collect_with_retry. The pause after the IP change command is needed so the new address has time to come up: the average change duration is 4.56 s, and 80.8% of changes complete within 5 seconds (as of 14.11.2026), so eight seconds of waiting is enough in the vast majority of cases.

Timer or link: which to choose for the parser

As of 14.11.2026, 51.1% of all IP changes on the network happen by timer, the rest — by link or API. That is, both approaches are used roughly equally, and the choice depends on the task. For background price monitoring the timer is simpler: you set the interval and the address changes by itself, the parser doesn't need to do anything. For reviews, where you need to scroll one page for a long time, the link is more convenient: you change the address between products, not in the middle of scrolling. You can also combine them — the timer as a background, the link as a reaction to errors.

Tip: if you use the timer, tune the interval to your pace. Estimate how many product pages you go through during the interval, and aim so that not too many requests come from one address. Start with the median value of 120 s (as of 14.11.2026) and watch the error rate in the log — this is your main indicator.

Check: after the run, the ozon.db file has appeared; open it with the free DB Browser for SQLite program and make sure the prices table has rows with today's date, and a second run of the review parser doesn't increase the number of rows in reviews for products already collected.

Step 7: Run collection on a schedule

Goal of this stage: the parser runs itself every day at a set time and writes a log from which you can tell that everything went well.

Logging

  1. At the top of both scripts add:
import logging
logging.basicConfig(filename='parser.log', level=logging.INFO, format='%(asctime)s %(levelname)s %(message)s', encoding='utf-8')
  1. Replace print with logging.info for regular messages and logging.error for errors. Now the history of runs is saved in parser.log, even when you're not looking at the console.

Scheduling on Windows

  1. Create a run.bat file in the project folder with the content: cd /d C:\путь\к\ozon_parser, on the next line venv\Scripts\python.exe parser_prices.py, on the third — venv\Scripts\python.exe parser_reviews.py.
  2. Open Task Scheduler (type its name in Windows search).
  3. On the right click Create Basic Task. Give it a name, e.g. Ozon Parser.
  4. Choose the Daily trigger and a time when the computer is definitely on.
  5. Action — Start a program. In the "Program/script" field specify the path to run.bat.
  6. Finish the wizard. Right-click the task — Run to test the launch manually.

Scheduling on macOS and Linux

  1. In the terminal type crontab -e.
  2. Add the line: 0 6 * * * cd /путь/к/ozon_parser && venv/bin/python parser_prices.py && venv/bin/python parser_reviews.py. This runs every day at six in the morning.
  3. Save the file. Check that the task was added: crontab -l.

Tip: for serious monitoring, move the parser to a small virtual server. It runs around the clock, doesn't depend on your laptop, and proxies connect the same way — the settings in config.py don't change.

Check: after the schedule triggers, parser.log has entries with the right date, and ozon.db has new rows in the prices table. If there are no entries, run run.bat manually from the terminal and see what error is output.

Checking the result: checklist and testing

Go through the list. Every item should pass — then your Ozon parser is ready for regular work.

Checklist

  • The virtual environment activates, playwright and chromium are installed.
  • check_proxy.py shows an address and a different address after the IP change.
  • parser_prices.py goes through the whole list without interruption and fills in price and in_stock for each product page.
  • The price from the parser matches the price in the browser for the same region.
  • For a product that's out of stock, in_stock is zero.
  • parser_reviews.py collects reviews with rating, date and text; there are no author names in the database.
  • A repeated run doesn't create duplicate reviews.
  • ozon.db accumulates history: one sku — many rows with different ts.
  • The task in the scheduler or cron runs and writes to parser.log.

How to test

  1. Take a product page that has a crossed-out old price and a card price. Check that all three fields are filled in correctly.
  2. Find a product page with the "Осталось N шт" label and make sure stock_left contains this number.
  3. Find a product page of an out-of-stock product and check in_stock.
  4. Run the review parser on a product with a small number of reviews and compare the count.
  5. Run the price parser twice in a row and build a query in DB Browser: SELECT sku, ts, price FROM prices ORDER BY sku, ts — you should see two rows per SKU.

Success indicators

The main indicator is the share of product pages for which data was obtained on the first attempt. Calculate it from the log: the number of error records to the total number of links. If errors grow over time, that's a signal to increase pauses, reduce the volume per run or shorten the rotation interval. The second indicator is schedule stability: every day the log has a start and a finish.

Common mistakes and solutions

The parser sees a check page instead of the product page

Cause: requests from one address are too frequent, or the browser profile looks suspicious (e.g., an empty viewport and a missing locale). Solution: increase pauses, set locale='ru-RU' and a normal window size, enable IP changes by link on error, and don't run several copies in parallel on one port.

The price is empty although it's on the page

Cause: the widget name or the text structure inside it changed. Solution: open the product page with F12, find the current data-widget attribute on the price block and update the selector in parse_price_widget. Check that ld_price is filled in — it will cover you while you make the fix.

Prices differ from what colleagues see

Cause: different delivery region. Solution: fix the city via the saved context state storage_state and use it in all runs. Always specify the collection region in reports.

Reviews are only partially collected

Cause: scrolling goes faster than batches load, or MAX_SCROLLS is too small. Solution: increase the pause between scrolls and the number of scrolls; allow more screens for new products.

407 error when launching the browser with a proxy

Cause: wrong credentials or swapped ports. Solution: check the login and password; remember that the HTTP port is one less than the SOCKS5 port (as of 22.09.2026).

The script fails on a timeout on the very first page

Cause: the proxy isn't responding or the network is unstable. Solution: run check_proxy.py, make sure the address is returned. If not — check in your account whether the port is active.

Duplicates in the prices table

Cause: the task in the scheduler triggered twice, or it was run manually on top of the schedule. Solution: this isn't a data error — history allows several measurements per day. If it bothers you, add grouping by date to queries or a check of the last record before inserting.

The parser works but is very slow

Cause: the headless browser loads images and extra scripts. Solution: block image loading via context.route — example in the advanced capabilities section.

Additional capabilities and optimization

Blocking unnecessary resources

A product page pulls dozens of images that the parser doesn't need. Add this after creating the context:

def block_media(route):
if route.request.resource_type in ('image', 'media', 'font'):
route.abort()
else:
route.continue_()
context.route('**/*', block_media)

Pages will load noticeably lighter, and traffic through the proxy will shrink.

Internal JSON responses instead of layout

For advanced users: in step 2 you saw requests in the Network tab that return JSON. Playwright can intercept responses: subscribe to the page.on('response', ...) event and, if the response address contains the needed fragment, parse its body via response.json(). That way you'll get the price and stock in structured form, without parsing text. The plus is parsing reliability; the minus is that the format of internal responses isn't documented and changes without warning, so keep the layout as a fallback source.

Multiple ports and distributing the list

When the list grows to thousands of items, one port becomes a bottleneck not because of speed, but because all requests come from one address at any given moment. Take several proxy ports, split products.txt into parts and run one process per port. Each process has its own config and its own log. Important: don't put several processes on one port.

Change notifications

The most useful application of history is alerts. Write a small script that, after each collection, compares the latest price with the previous one for each sku and, if the change is greater than a set threshold or the product went out of stock, sends a message — to email or a messenger via their official APIs. That's how monitoring turns from a table into a decision-making tool.

Review analysis

The reviews table is ready material for analytics. Calculate the share of low ratings by month, highlight frequent words in cons, compare the rating dynamics of your product page and competitors'. For a simple start, pandas is enough: load the table, group by sku and by month of the date, calculate the average rating.

Asynchronous variant

Playwright has an asynchronous API. It lets you keep several tabs at once in one process. But remember the main rule: parallelism increases the frequency of requests from an address. If you switch to async, increase the number of ports proportionally instead of squeezing one.

FAQ: common questions about the Ozon parser

Is it legal to scrape Ozon?

Collecting public data for your own analytics is generally acceptable, but you must comply with personal data laws and not disrupt the site's operation. Don't collect user data, don't create load comparable to an attack, and don't use data in ways that violate rights holders' rights and the platform's rules. If in doubt — consult a lawyer.

Can I do without proxies?

For a one-off check of a dozen product pages — yes. For daily monitoring of hundreds of items, proxies are needed: one address with a long identical session quickly gets checks, and collection becomes unstable.

Why mobile proxies and not server ones?

Mobile carrier addresses are used by a huge number of regular subscribers and change constantly — this is a natural profile for a site designed for smartphone shoppers. As of 14.11.2026, the Beeline carrier's modems alone had 106,782 unique IPs per day, MegaFon — 65,541, Tele2 — 56,412, MTS — 39,111. Your parser doesn't stand out in this stream.

How often should I change the IP?

It depends on the pace. The starting point is the network median interval, 120 s (as of 14.11.2026). Then watch the error rate in the log: if it grows — shorten the interval or slow down the parser.

Can I collect prices via regular HTTP requests without a browser?

Partially. The product page is assembled by scripts, and bare HTML often doesn't contain the data. The advanced path is to intercept internal JSON responses, but their format is unstable. For beginners a headless browser is the most predictable option.

What should I do if the parser stopped working after a site update?

Run it with headless=False, see what changed on the page, update the selectors in selectors.txt and the corresponding functions. Thanks to the split into functions, the fix takes minutes.

How to store price history for a long time?

SQLite easily holds years of daily measurements across thousands of items. Make a copy of the ozon.db file once a week to cloud storage — that's your backup.

Can I track my own products with the same parser?

You can, but for your own products it's better to use the official seller API: the stock data there is accurate and doesn't depend on the storefront region. Leave the parser for other people's product pages.

How many products can I process?

The limit is not the code but care: pauses, number of ports and rotation interval. Start with a small list, record the error rate, then increase the list and the number of ports while keeping this indicator stable.

Conclusion

You've gone the whole way: set up the environment, studied the structure of an Ozon product page, connected mobile proxies with rotation by timer and by link, wrote collectors for prices, stock and reviews, moved the results into a database with history and put the parser on a schedule. Now you have your own monitoring tool that doesn't depend on third-party services and that you understand down to the last line.

What to do next? First, let the parser run for a week and look at the log: stability matters more than speed. Second, add notifications about price changes and products going out of stock — they're exactly what turns a table into a working tool. Third, start analyzing reviews: even a simple summary of ratings and frequent words in cons gives you ideas for improving product pages.

Where to grow: master intercepting internal JSON responses, move to several ports with list distribution, move the system to a server and build a simple dashboard with charts on top of the database. And when you need to expand your pool of addresses, MobileProxy.Space mobile proxies scale as easily as the first port from this guide. Good luck collecting data — and remember that a careful parser lives longer than a fast one.