Retrieve published annual total revenue and average employee counts for Slovenian companies, preserving the exact financial-data URL and reporting only displayed years and values.
Use Cases
- Find the latest 3–5 financial years for a Slovenian company.
- Extract revenue and employee history for multiple Slovenian companies.
- Resolve a company from its name, identifier, or registration number.
- Detect explicit no-results responses for an unavailable company search.
Automation Flow
- Navigate to
https://www.companywall.si/iskanje?n={query}and resolve the exact company from the result links:
(() => [...document.querySelectorAll('a[href*="/podjetje/"]')].map(a => ({text:(a.innerText||a.textContent||'').trim().replace(/\s+/g,' '), href:new URL(a.getAttribute('href'), location.href).href})).filter(x => x.href.includes('/podjetje/')))()- Select the exact matching result, copy its slug and opaque ID, then navigate directly to
https://www.companywall.si/podjetje/{slug}/{company-id}/financni-podatki. - Activate the financial statement tab with
a#bankaccounts-tab, wait about 1 second for the table, then run:
(() => {
const norm=s=>(s||'').toString().normalize('NFD').replace(/[\u0300-\u036f]/g,'').toLowerCase().replace(/\s+/g,' ').trim();
const number=s=>{s=(s||'').replace(/\s/g,'').trim();if(!s)return null;const neg=/^\(.*\)$/.test(s);s=s.replace(/[()]/g,'').replace(/[^0-9,.-]/g,'');if(s.includes(',')&&s.includes('.'))s=s.lastIndexOf(',')>s.lastIndexOf('.')?s.replace(/\./g,'').replace(',','.'):s.replace(/,/g,'');else if(s.includes(','))s=s.replace(',','.');else if((s.match(/\./g)||[]).length>1||/\.\d{3}$/.test(s))s=s.replace(/\./g,'');const v=Number(s);return Number.isFinite(v)?(neg?-v:v):null};
const yearRE=/\b(19|20)\d{2}\b/;
const revenue=s=>/(celotni prihodki|prihodki skupaj|totalni prihodki)/.test(norm(s));
const employees=s=>/(povprecno stevilo zaposlenih|povprecno zaposlenih|povprecno stevilo delavcev|stevilo zaposlenih)/.test(norm(s));
const out={url:location.href,company:(document.querySelector('h1')?.innerText||document.title||'').trim(),years:{},tables:[]};
for(const table of document.querySelectorAll('table')){const rows=[...table.querySelectorAll('tr')].map(tr=>[...tr.querySelectorAll('th,td')].map(c=>(c.innerText||c.textContent||'').trim()));const yearByCol={};for(const row of rows)row.forEach((v,i)=>{const m=v.match(yearRE);if(m)yearByCol[i]=m[0]});if(!Object.keys(yearByCol).length)continue;const found=[];for(const row of rows){const label=row.find(v=>v&&!yearRE.test(v))||'';const metric=revenue(label)?'totalRevenue':employees(label)?'averageEmployees':null;if(!metric)continue;row.forEach((v,i)=>{const y=yearByCol[i];if(y&&v!==label){if(!out.years[y])out.years[y]={year:Number(y),totalRevenue:null,averageEmployees:null};const n=number(v);if(n!==null)out.years[y][metric]=n}});found.push(metric)}if(found.length)out.tables.push({metrics:[...new Set(found)],years:Object.values(yearByCol).map(Number).sort()})}
out.records=Object.values(out.years).sort((a,b)=>a.year-b.year);delete out.years;out.availableYears=out.records.map(r=>r.year);return out
})()- Return the latest
{count}published records, normally 3–5, preserving nulls for blank cells and identifying unavailable years as missing.
Params
| Param | What it does | Example value |
|---|---|---|
| query | Company name or identifier used in the search URL | KRKA, D.D., NOVO MESTO |
| company-id | Opaque ID copied from the matching search result | MM5LgAk0 |
| slug | URL slug copied from the matching search result | krka-dd-novo-mesto |
| count | Number of latest published years to return | 5 |
| years | Optional requested year window; otherwise use latest published years | 2021-2023 |
Possible Friction Points
- Search returns multiple similarly named entities → select the result whose name or identifier exactly matches the request; never invent the opaque ID.
- Search shows
Ni rezultatov.orNi najden noben rezultat.→ verify the URL-encoded query and report that no matching company was found. - Financial tables are empty before the financial statement tab is selected → click
a#bankaccounts-tab, wait about 1 second, then run the evaluator. - Employee row is labeled
ŠTEVILO ZAPOSLENIHrather than an average-specific phrase → map that row toaverageEmployees. - reCAPTCHA or reCAPTCHA-v3 markers appear while the requested content remains accessible → continue without solving the challenge.
- Cookie-consent overlay blocks interaction → click
button#agree-btnonce, then continue. - Financial markup changes → inspect table rows and update the structural selectors while retaining the year-column and Slovenian-label logic.
Example Result
{
"url": "https://example.com/",
"company": "Example Title",
"tables": [
{
"metrics": [
"totalRevenue",
"averageEmployees"
],
"years": [
2023,
2024
]
}
],
"records": [
{
"year": 2023,
"totalRevenue": 1000,
"averageEmployees": 10
},
{
"year": 2024,
"totalRevenue": 1200,
"averageEmployees": 12
}
],
"availableYears": [
2023,
2024
]
}