Efficient Hybrid Parsing for 1C-Bitrix Content Automation

Our company is engaged in the development, support and maintenance of Bitrix and Bitrix24 solutions of any complexity. From simple one-page sites to complex online stores, CRM systems with 1C and telephony integration. The experience of developers is confirmed by certificates from the vendor.
Showing 1 of 1All 1626 services
Efficient Hybrid Parsing for 1C-Bitrix Content Automation
Medium
~1-2 weeks
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1368
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    956
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    699
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    843
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    737
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    1086

Efficient Hybrid Parsing for 1C-Bitrix Content Automation

Imagine an editor manually copying articles from external sources. One publication takes 4 hours—analyzing structure, cleaning formatting, uploading images, SEO alignment. For 500 articles, that's 2000 man-hours. We automate this: hybrid parsing based on Mozilla Readability and custom CSS selectors cuts time to 10 minutes per article with 95%+ accuracy. With over 10 years in the industry and 500+ successful projects, we deliver reliable automation that saves over $50,000 annually. Get a preliminary analysis of your sources—we'll assess complexity and timeline.

Why Article Parsing Is Harder Than News Parsing

News parsers work with RSS feeds—structured, predictable data. Article parsing deals with arbitrary HTML pages where each source has its own layout, navigation structure, and content presentation. Key differences:

  • No unified format—each source needs a custom parser or a universal extractor.
  • Complex content structure—articles contain headings, lists, tables, embedded media, code blocks. All must be preserved.
  • Larger text volume—5,000–10,000 characters vs. 500-character news. More data means more failure points.
  • Lower update frequency—articles are published less often, but each piece is more valuable.

What Problems Does Efficient Hybrid Parsing Solve?

The hybrid approach combines an algorithmic extractor (Mozilla Readability) with custom CSS selectors for sites where automation fails. The library andreskrey/readability.php (PHP port of Readability) analyzes text density and extracts main content in 2 seconds. For sources where Readability misses tables or lists, we add exception selectors. Result: 95%+ accuracy on 10+ sources.

Compare approaches: pure Readability preserves 80% structure but loses 30% of tables and 15% of lists. Manual selectors give 99% accuracy but require 15 minutes per source. Hybrid delivers 95% accuracy at 0.5 minutes per source—30x faster than selectors and 2x more accurate than pure Readability for tables.

How to Preserve Structure and Formatting During Extraction?

After extracting HTML, it must be converted to a format suitable for Bitrix infoblock DETAIL_TEXT. We use HTMLPurifier with custom config allowing h2–h4, p, ul, ol, li, table, img, a, strong, em, blockquote, pre, code. Cleaning steps:

  • remove script, style, iframe, inline styles, data-attributes;
  • normalize headings: original h1 becomes h2 in Bitrix context;
  • localize images: download external images to /upload/, replace URLs in HTML;
  • handle lazy loading (data-src instead of src).

The final HTML is validated and checked against the infoblock schema.

Content Extraction: Three Approaches

Approach Principle When to Use
CSS selectors Selector for specific site (.post-content) Up to 5 sources, stable layout
Algorithms (Readability) DOM analysis via text density heuristics 5+ sources, heterogeneous layout
Hybrid Readability + custom rules for errors 10+ sources, maximum accuracy

Readability on PHP completes in 2 seconds vs. 15 minutes for manual selector per source—a 450x gain for 10 sources. In practice, hybrid is the only approach that works for 10+ sources. Pure automation loses critical blocks (tables, lists); pure selectors don't scale.

Step-by-Step Article Parsing Process

  1. URL collection. The parser crawls listing pages (pagination, categories, sitemap.xml) and collects article URLs. They are saved to a queue table parser_queue with fields url, status, created_at.
  2. Download and extraction. For each URL in queue: download HTML, extract content, parse metadata. Result is a structured array saved to intermediate table parser_articles.
  3. Moderation (optional). An administrator reviews parsed articles in the interface, approves or rejects. For full automation, this step is replaced by rule-based filtering.
  4. Import. Approved articles are loaded into an infoblock via CIBlockElement::Add() from the Bitrix API. Images are saved through CFile::MakeFileArray().

Mapping to Infoblock

Extracted Data Infoblock Field Processing
Heading h1 / title NAME Trim to 255 chars, strip HTML
First 300 chars of text PREVIEW_TEXT strip_tags() + cut at sentence boundary
Full article HTML DETAIL_TEXT Clean through HTMLPurifier
First image PREVIEW_PICTURE Download + resize
Source URL PROPERTY_SOURCE_URL As-is
Publication date ACTIVE_FROM Parse via strtotime()
md5(url) XML_ID For deduplication
Author PROPERTY_AUTHOR Extract from meta or byline
Tags / keywords PROPERTY_TAGS Multiple string property

How to Protect the Parser from Blocking?

Content sites are less protected than marketplaces, but basic measures exist:

  • robots.txt—check Disallow for parsed sections. Ignoring adds legal risk.
  • Rate limiting—1–2 requests per second are safe for most sites. Aggressive parsing leads to blocking.
  • JavaScript rendering—SPA sites require headless browsers. For static sites, cURL suffices.
  • Cloudflare / WAF—detect bots by fingerprint. Solved with headless browser and realistic headers.

Cron Automation

Recommended cron schedule
# Collect new URLs from sources—once daily
0 2 * * * php /home/bitrix/parsers/collect_urls.php

# Parse articles from queue—every 2 hours
0 */2 * * * php /home/bitrix/parsers/parse_articles.php --limit=50

# Import into infoblock—every hour
0 * * * * php /home/bitrix/parsers/import_articles.php

Splitting into three tasks allows independent control of each stage and quick problem localization.

Turnkey Work Scope & Deliverables

  • Source analysis: Identify 5–15 donor sites, examine DOM, spot layout peculiarities.
  • Parser development: Hybrid PHP modules (Readability + custom selectors).
  • Mapping and import: Configure infoblocks, properties, deduplication.
  • Testing: Check on 50+ real articles, fine-tune.
  • Documentation: Architecture description, guide for adding new source.
  • Support: 3-month warranty: fix bugs, adapt to layout changes.
  • Knowledge transfer: 2-hour training session for your team.

We will assess your project—just contact us. Our team is certified on the 1C-Bitrix platform with 10+ years of experience and has delivered 500+ content automation projects. Estimated project cost: $2,500 for a 5-source parser, saving approximately $50,000 annually in manual labor—a 95% reduction in effort. We guarantee solution stability even during donor site redesigns.

FAQ for this article is provided as structured data (see JSON-LD above) and is not inline content.

Parser Development for 1C-Bitrix: Where to Start?

XMLReader, not SimpleXML — the choice of tool determines the project's fate. SimpleXML loads the entire XML into memory, and with an 800 MB supplier file, PHP will crash with a fatal error on a 512 MB limit. XMLReader processes streamingly, node by node, consuming 20–30 MB — 30 times more efficient. This detail starts any parser development for Bitrix. With over 10 years of Bitrix development and 50+ parser projects delivered, we know the pitfalls. Contact us to start your parser development today.

What Problems Does Parsing Solve?

  • Primary catalog filling — 15,000 cards with descriptions, characteristics, photos. Manually, that's three months of content manager work; a parser takes a week with debugging.
  • Competitor price monitoring — collecting data from Ozon, Wildberries, competitor sites. A competitor drops the price on a hot item — you find out in two hours, not two weeks.
  • Supplier aggregation — five price lists in different formats (CSV with CP1251, XML in CommerceML, Excel with merged cells) become a single catalog with a unified property system.
  • Card enrichment — pulling characteristics, instructions, 3D models from manufacturer sites. Without this, a product card is an SEO empty shell.
  • Assortment update — products missing from the supplier feed are deactivated via CIBlockElement::Update($ID, ['ACTIVE' => 'N']). New ones are created. The catalog stays synchronized.

What Tools Do We Use in Parser Development?

Static websites — PHP (Goutte, Symfony DomCrawler) or Python (Scrapy, lxml). Speed: 50–100 pages/sec. Sufficient for catalogs without JS rendering.

SPA and dynamic websites — Puppeteer or Playwright. Infinite scroll, AJAX filters, lazy-load images — headless browser handles it all. Speed drops to 1–10 pages/sec, but there is no alternative: data exists only after JavaScript execution.

Supplier files:

  • Excel (XLS, XLSX) — PhpSpreadsheet. Beware of merged cells and formulas — they break automatic mapping.
  • CSV — fgetcsv() with correct encoding. Suppliers love CP1251, BOM in UTF-8, and semicolons instead of commas. All need detection and handling.
  • XML/YML — XMLReader for large files, SimpleXML for feeds up to 50 MB.
  • CommerceML — standard exchange format with 1C. We parse import.xml and offers.xml, map to information block structure.

API — Supplier REST endpoints, marketplace APIs (Ozon Seller API, Wildberries API). We work within rate limits, handle pagination.

How Is the Auto-Population Pipeline Structured?

Four stages. Each can break in its own way.

  1. Collection. Parser crawls sources via cron schedule. Raw data goes to an intermediate table — not directly into b_iblock_element. Log everything: pages visited, elements parsed, where we got 403 or timeout. Without logs, debugging a parser is like fortune-telling.

  2. Normalization. Main work here:

    • Clean HTML tags, extra spaces, Unicode garbage
    • Units: "mm" → "mm", "millimeters" → "mm", "миллиметр" → "mm"
    • Map supplier categories to Bitrix information block sections. One supplier has "Notebooks", another "Notebooks and tablets", third "Laptops" — all into one section
    • Deduplication by SKU, EAN/GTIN. One product from three suppliers should not appear three times
  3. Load into Bitrix. Via CIBlockElement::Add() for new elements, CIBlockElement::Update() for existing. Images: download, resize via CFile::ResizeImageGet(), convert to WebP. Properties via CIBlockElement::SetPropertyValuesEx(). SEO meta via \Bitrix\Iblock\InheritedProperty\ElementValues. SEF URLs generated from name transliteration.

  4. Update. Key point — not overwrite manual edits by content manager. Update only price, stock, activity. Description and photos manually edited are flagged with UF_MANUAL_EDIT property and skipped during import. Products missing from feed are deactivated, not deleted.

Why Is Competitor Price Monitoring Necessary?

A separate subsystem with its own specifics:

Parameter How It Works
Frequency From once a day to every 2 hours — depends on market volatility
Matching By SKU, EAN, fuzzy name comparison via Levenshtein distance
Storage Separate vendor_price_monitor table with history, not information blocks
Alerts Telegram/email when competitor price deviation exceeds X%
Auto-rules "Keep price 3% below competitor minimum, but not below cost + 15%"

Result — dashboard: your product vs competitors, price history, trends. The manager sees where to raise price without losing position, and where to react.

CSV/XML Import Module: Customization for Your Format

For supplier files — custom module with admin panel:

  • Configurable mapping: "column B in file → BRAND property of information block"
  • Auto-detect encoding (CP1251, UTF-8, UTF-16) via mb_detect_encoding() with validation
  • Download images from URL with queue — to avoid channel saturation
  • Incremental update by row hash: row changed — update, no — skip
  • Cron schedule, report: created 145, updated 892, errors 3 (with details)

Large files: CSV processed in batches of 1000 rows via fgetcsv() (10 times faster than row-by-row), XML streamed via XMLReader, background execution via Bitrix agent queue — no PHP timeouts.

Legal Aspects to Consider

  • robots.txt — respect it. Crawl-delay — comply.
  • Request frequency — 1–2 per second, no more. Don't DDoS someone else's site.
  • Manufacturer content — use it. Unique author texts — don't copy.
  • Personal data — don't collect.

What Is Included in a Turnkey Parser Development?

Component Description
Prototype Parser for 1–2 sources in 2–3 days to assess data quality
Main parser Full data collection from one source (static/dynamic)
Bitrix import module Normalization, loading, update, mapping admin panel
Price monitoring If needed — collection and alert system (up to 10 competitors)
Documentation Architecture description, selector update instructions
Support 3-month guarantee for uninterrupted operation, fix for donor layout changes

How We Work and Deadlines

  1. Prototype — parser for 1–2 sources in 2–3 days. Assess data quality, pitfalls (Cloudflare protection, captcha, dynamic loading).
  2. Development — full pipeline: parser → normalization → import into Bitrix → admin panel for management.
  3. Testing — run on full catalog volume, check edge cases (empty fields, malformed HTML, broken images).
  4. Launch — configure cron, error monitoring via Telegram bot.
  5. Support — competitor changed layout? Update CSS selectors in parser.
Task Deadlines
Single site parser (static HTML) 3–5 days
SPA site parser (Puppeteer/Playwright, bypass protection) 1–2 weeks
CSV/XML import module for Bitrix 1–2 weeks
Price monitoring system (5–10 competitors) 2–4 weeks
Comprehensive auto-population system 4–8 weeks
Parser support and adaptation by subscription

Get in touch for a free consultation — we will analyze your data sources and propose the optimal parser architecture. Request a project assessment today and get a fixed deadline. We guarantee stable parser operation and full support throughout the usage period.