Skip to content
IT Optimization
DataJuly 18, 2026•14 min

Data parsing: files, databases and websites

The word "parsing" covers three different jobs: breaking down a file, pulling data out of someone else's database and collecting information from a website. They have one thing in common: the data sits in an awkward form and you need it in a usable one. We'll go through all three, with examples of what usually breaks.

Data parsing: files, databases and websites
Cover image generated with AI

What parsing is and why a business needs it

Parsing (literally, breaking something down into its parts) is the automatic conversion of data from an awkward format into a usable one. A parser reads the source, finds the fragments you need, brings them to a single format and puts them where they can be worked with: a spreadsheet, a database or a CRM.

The key word here is "automatic". You can do the same job by hand: open the supplier's price list, copy the item name, find it in your own system, type in the new price. With a hundred items that's an evening. With a hundred thousand it's a job that simply cannot be done: by the time you reach the end of the catalogue, the prices at the start will already be out of date.

Hence the typical reasons: filling a catalogue from supplier price lists, updating prices and stock levels daily, moving data from an old system to a new one, combining exports from several sources into one report, monitoring the market. Wherever data arrives regularly and in someone else's format, a parser replaces not a programmer but the person who used to copy cells.

Parsing files: CSV, Excel, XML, JSON, PDF

The most common kind, and also the most underestimated. Reading an Excel file looks like a five-minute job, and for a tidy file that's true. The problems start when the file was made by a person.

CSV is plain text with delimiters. The pitfalls: the delimiter may be a semicolon or a tab rather than a comma; the same characters turn up inside values; line breaks hide in the middle of a field. It is read with the language's standard tools or with pandas, which handles most dialects on its own.

Excel (XLSX, XLS) is the most temperamental format, because it isn't a data table but a canvas to draw on. Merged cells, a header spread over three rows, a product and its SKU on different levels, numbers saved as text, blank separator rows between sections. It is parsed with openpyxl or pandas, but most of the work goes not into reading but into restoring the structure the author kept in their head.

XML and JSON were designed for machines, and they are usually the easiest: the structure is stated explicitly. XML is read with lxml, JSON with the language's standard tools. The difficulty comes with large volumes: a file of several gigabytes can't be loaded into memory in one go, so it is parsed as a stream, one element at a time.

PDF is a format for printing, not for data. It has no rows or columns, only characters with coordinates on the page. A table is "visible" to a human only because the characters are lined up. Libraries such as pdfplumber and PyMuPDF rebuild the structure from those coordinates, and on tidy documents this works well.

DBF is a legacy of FoxPro and old accounting systems, and it still turns up in data exchange with accounting and the warehouse. It is read with specialised libraries; the main difficulty is the encoding, which we cover below.

Logs are text files whose lines all follow one format. They are parsed with regular expressions, and the main work here is not reading but aggregation: counting, grouping, finding anomalies.

What usually breaks when parsing files

Encodings. Russian text in old exports comes in CP1251 or CP866, while the program expects UTF-8 by default, and the output is mojibake, garbled characters. It's worse when the encoding changes from file to file: then it is detected automatically, with libraries such as chardet, and you still keep the option of setting it by hand, because auto-detection gets short strings wrong.

Merged cells in Excel. To a person, a merged cell means "this heading applies to all the rows below". To a program it is one value in the first cell and nothing in all the others. You have to restore the logic: carry the value down to the next filled cell, and tell a section heading from a product row.

Scans instead of text in PDF. The document looks like a table, but inside it is an image. No text-parsing library will help here; you need OCR, recognition with Tesseract or cloud services. That is a fundamentally different level of reliability: recognition makes mistakes with digits, confuses zero with the letter O, and the result always has to be checked. If the supplier has the same price list in Excel, it's cheaper to ask for it than to recognise a scan.

We have met all of these cases on real projects, and they lead to one conclusion: the time goes not into reading the format but into handling exceptions. That's why we always give an estimate after we've looked at the real files, not at a description of them.

Parsing databases

The second big kind is when the data sits not in a file but in someone else's database or an outdated one. There are three types of task here.

Migration. A company is moving from an old system to a new one, and the data has to be transferred: customers, orders, products, history. The difficulty is that the structures don't match: what was one field in the old database is split into three in the new one, and reference data has to be matched by hand.

Exports for reports. The data exists, but you can't get at it through the interface: you need a slice the system can't produce. The parser queries the database directly, collects what's needed and passes it to a report or a BI system.

Synchronisation. Two systems must see the same data: for example, warehouse stock in the accounting system and stock levels on the website. This is no longer a one-off export but a regular exchange with conflict handling: what to do if a record has changed in both systems.

In practice we have worked with PostgreSQL, MySQL, MS SQL Server, SQLite and databases of 1C, Russia's most widespread accounting platform. Technically, connecting to any of them is routine; all the difficulty lies in understanding someone else's schema. Table names like SC1247 and field names like SP2891 are normal for 1C, and working out a structure like that takes longer than the export itself.

When you aren't given access to the database

A common situation: you need the data, but there is no direct access to the database. The system's owner isn't prepared to open it up to the outside, the contractor who built it can't be reached, or the licence simply doesn't allow external connections.

Then you work through whatever is available. If the system can export reports, you parse the exports, and the task comes down to the file parsing covered above. If there is an API, even an undocumented one, you use it. As a last resort the data is taken through the web interface: the program logs in under an account with legitimate access and goes through the same screens a person would.

The last option works, but it is the most fragile: it breaks with any update to the interface. We warn about this in advance and suggest it only when the other routes are closed, and at the same time we advise you to negotiate proper access after all, because it is cheaper to maintain.

Parsing websites

The third kind is collecting data from web pages. Here the source doesn't hand you a file, and the structure has to be extracted from the markup.

The simple case: the server returns ready-made HTML. The parser loads the page with an HTTP client, parses the markup with BeautifulSoup or lxml and pulls out the data by selectors: "the price is in this block with this class". For large projects with hundreds of thousands of pages, the Scrapy framework is used: it manages the request queue, concurrency and retries itself.

The hard case: the page is assembled in the browser. The server returns an empty shell, and the content is loaded by scripts. Then a headless browser is used, Playwright or Selenium: it actually opens the page, waits for it to load and returns the final markup. This is slower and needs more resources, so it is used when the simple route doesn't work.

It's also worth checking whether the source has an official API. It is almost always faster, more stable and more legitimate than parsing the markup, and it's the first thing we check when we take on a job.

What to do if the source is closed to collection

Websites protect themselves from mass collection: they limit request rates, show a CAPTCHA, require a login, block by IP address. That is the owner's legal right: they pay for the servers and are entitled to decide who uses them.

Our position here is simple, and we talk it through with the client at the start. A well-behaved parser acts like a polite guest: it pauses between requests, creates no more load than an ordinary visitor, identifies itself honestly in its headers, respects robots.txt and doesn't go behind a login without the owner's permission. With this approach most sources can be collected without any tricks: blocks are usually triggered by aggressive collection, not careful collection.

If, however, the source is deliberately closed (there's a CAPTCHA, access is for customers only, the terms of use explicitly forbid it), we say so plainly rather than start getting around the protection. Circumventing technical protection measures moves the task out of development and into legal risk, and the risk is the client's: it is the client who is later answerable for the collected data.

Instead, we offer routes that work: ask the owner for official access or an export (this works more often than people think); find the same data in an open source or from an aggregator; buy a ready-made dataset. Clients sometimes don't like this answer in the moment. But a project that runs into a block or a legal claim a month later costs more than an honest "we can't take this source, let's look for another one".

Parsing search queries

On the Russian-language internet, "parsing" has one more meaning: collecting search queries, that is, keyword research. The technique is similar, but the purpose is different: what you collect is not products but what people search for.

The sources here are query statistics services such as Yandex Wordstat, the keyword tool of Russia's main search engine, along with search suggestions and ready-made keyword databases. The output is a list of phrases with search volumes, which is used to build the site structure and plan content.

Most of these services have official APIs, and working through them is the right way rather than scraping the interface: it doesn't breach the terms of use and doesn't break when the site is redesigned. To be honest, this is more an SEO task than a development one, and we take it on as part of larger projects rather than as a separate service.

Why parsers break and how to prevent it

A parser is just about the only kind of program that breaks not because something was changed in it, but because something changed outside it. The supplier changed the header in the price list, the website updated its layout, a new field appeared in the database, and collection that worked yesterday returns nothing today or, worse, rubbish.

You can't avoid this entirely, but you can make sure a breakdown isn't a disaster. The first measure is checking the result on the way in, not on the way out. The parser knows what to expect: if forty rows arrive from a price list of ten thousand, if a price turns negative, if half the columns disappear, it stops and reports the problem instead of loading corrupted data into the production database.

The second is alerts. A silent failure is worse than a loud one: the data quietly goes stale, and you find out a week later from a customer complaint. So the parser logs every run to monitoring and sends a notification to Telegram or by email if something goes wrong.

The third is anchoring to meaning, not position. A column in Excel is found by its header name, not its number; data on a page is found by stable attributes, not by a long chain of nesting that will break with any design change.

The fourth is keeping the source material. Downloaded files and pages are stored as they are, so when something fails you can see exactly what changed. Without this you are debugging blind.

The fifth is graceful degradation. If one optional field out of twenty fails to parse, it is better to write the other nineteen and flag the gap than to bring down the whole export.

Legal limits

Collecting publicly available data is lawful in itself, but there are limits, and it's worth knowing them before you start.

Personal data. Names, phone numbers, addresses and email addresses are personal data under Federal Law 152-FZ, Russia's personal data law, even if they are publicly available. Collecting them makes you a personal data operator, with all the obligations that follow. The rule is simple: if the task can be solved without personal data, solve it without.

Copyright. Texts, photographs and descriptions are protected by copyright regardless of how you obtained them. Collecting someone else's product descriptions for internal analytics and publishing them on your own website are fundamentally different things in the eyes of the law.

Terms of use and robots.txt. A robots.txt file isn't a legal document, but it expresses the owner's wishes, and ignoring it becomes an argument against you. A website's user agreement may explicitly prohibit automated collection, and that is already a contractual matter.

Load. Collection that interferes with someone else's service is a separate story, and it is closer to unlawful interference than to harmless reading of public pages.

The practical conclusion: collect only what the task really needs, don't touch personal data without a legal basis, don't publish other people's content as your own, and don't create load. In borderline cases it's cheaper to show the task to a lawyer than to sort things out afterwards.

How much it costs and how long it takes

The cost of a parser is determined not by the volume of data but by the number of exceptions. Collecting a million rows from tidy XML is easier and cheaper than collecting a thousand from a dozen messy Excel files with different structures.

Our guide figures are these. A simple parser with one source and export to a spreadsheet: from $600. A system with several sources, automatic scheduled collection and export to a database or CRM: from $1 300. Complex cases with protected sources, a resilient architecture and monitoring: from $2 700.

As for timelines: a simple parser usually takes one to two weeks, regular collection from several sources two to four weeks, and a large system with monitoring from a month and a half. Most of this time goes not into code but into working through exceptions in the real data.

What affects the price most: the number of sources and the variety of their formats; whether a headless browser is needed; how dirty the source data is; whether reference data has to be matched; how often it updates and what reliability is required. That's why we don't name a figure from a description of the task: first we look at the real files or pages, and only then do we estimate.

And a fair warning: a parser needs ongoing support. Sources change, and every few months something has to be fixed. A one-off build without support is a saving that ends with the data quietly ceasing to update six months later.

Example: a catalogue of 100,000 items

One of our projects was an online shop selling spare parts for heavy machinery. The task was to fill the catalogue: around a hundred thousand items from the supplier, with part numbers, specifications, prices and the machine assemblies they belong to.

There's no way to do this by hand: even at one minute per item it comes to more than a year of one person's work. We collected the data automatically, brought part numbers and names to a single format, matched the product range against the internal reference data and set up regular price and stock updates, so the catalogue wouldn't go out of date the day after launch.

The main work, as usual, was not in collection but in normalisation: the same product had different names at the supplier and at the client, some specifications were written into the general text description, and some part numbers differed only in letter case and spaces.

The result is a catalogue in which customers find the part they need themselves, instead of phoning to check availability.

How we work

We start with real data: we ask you to send sample files, access to a test database or links to the pages. We don't give an estimate based on a description of the task: too often the description and the actual content differ.

Next we design: which fields are needed, how to match them with your reference data, how often to update, where to export, what to do if something fails. Then we build and launch collection with monitoring, so you hear about a problem from the system rather than from a customer.

We deliver the result where it is used: a spreadsheet, a database, a CRM or an API exchange with your system, with no manual copying in between.

The short version

  • Parsing covers three different jobs: breaking down files, extracting data from databases and collecting it from websites.
  • The time goes not into reading the format but into handling exceptions: broken encodings, merged cells, scans instead of text.
  • If a source has an API or an official export, it is always better than parsing the markup.
  • We don't get around anti-collection protection: if a source is deliberately closed, we look for a legal route to the same data.
  • A parser must check its results and report failures: a silent breakdown is worse than a loud one.
  • Personal data falls under 152-FZ even when it is publicly available.

Hand it to us

Understanding it yourself is one thing; getting it built and working is another. These are the areas where we solve the problems this article is about.

Tell us what you need built

Write to us whichever way suits you — messenger, phone or email. We will reply and suggest a way of working.

Telegram@dujaiiWhatsApp+7 996 326-61-61