Skip to content

Commit f544ee1

Browse files
authored
Merge pull request #385 from openzim/fix_header
Fix extraction of header on non-stackoverflow and non-stackexchange domains
2 parents 55a7c8e + fea189e commit f544ee1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
### Fixed
11+
12+
- Fix extraction of header on non-stackoverflow and non-stackexchange domains (#385)
13+
1014
## [3.0.1] - 2025-12-18
1115

1216
### Fixed

src/sotoki/scraper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def _get_site_details(self):
9595
if not title_tag or not title_tag.string:
9696
raise Exception("Failed to extract site title from homepage")
9797
site_title = title_tag.string
98-
if "stackexchange" in context.domain:
98+
if "stackoverflow" not in context.domain:
9999
# For "regular" stackexchange domains, use the whole header
100100
header_tag = soup.find("header", class_="site-header")
101101
if not header_tag:

0 commit comments

Comments
 (0)