Tool.Yun
أدوات مفيدة للمطورين
CSV إلى JSON
JSON Linter
JSON إلى .env
JSON إلى C#
JSON إلى CSV
JSON إلى Go
JSON إلى MessagePack
JSON إلى TOML
JSON إلى TS
JSON إلى XML
JSON إلى object
JSON إلى البيانات
JSON إلى كيان Java
Json Escaper/Unescaper
Json إلى PHP-Array
Json إلى Python
Json إلى SQL DDL
Json إلى مخطط
PHP-Array إلى JSON
tools.json-patch.name
أداة التحويل الى نص بتنسيق JSON
أداة ترتيب JSON
استعلام Json
تجميل وتنسيق JSON
تحويل Json إلى كود PHP
تحويل ObjGen إلى JSON
حزمة الرسائل إلى JSON
دمج JSON
محرر JSON
محلل حجم JSON
محول JS إلى JSON
محول JSON إلى JS
محول JSON إلى YAML
مصغر JSON
مقارنة JSON
مُختبر Jq/JSONPath
مُسطّح/غير مُسطّح JSON
TOML إلى JSON
تحويل TOML إلى YAML
تومل لينتر
دليل أوامر Tmux
دليل أوامر Zellij
دليل أوامر الشاشة
دليل مختصر لـ PowerShell
ملخص أوامر Git
ورقة الغش Jq
ورقة الغش Markdown
ورقة الغش Nginx
ورقة الغش Sed
ورقة الغش VIM
ورقة الغش الخاصة بـ Docker
ورقة الغش الخاصة بـ Docker SWARM
ورقة الغش الخاصة بـ Dockerfile
ورقة الغش الخاصة بـ Regex
ورقة الغش باش
ورقة الغش لـ Docker Compose
ورقة الغش لقواعد بناء جملة JSONPath
ورقة الغش نانو
ورقة غش Git Semantic Commit
ورقة غش K8s
ورقة غش تعبيرات عادية شائعة
ورقة غش لأمر chmod
ورقة غش لقواعد XPath
ورقة غش لمحددات CSS
XML Linter
XML إلى JSON
تحويل ObjGen إلى HTML
منسق XML
مُختبر XPath
مُختبر XSLT
أداة اختيار البطاقات
رمي النرد
عجلة الحظ
قاذفة العملة
tools.epc-qrcode-generator.name
فك رمز الاستجابة السريعة
قارئ الباركود
مولد الباركود
مولد رمز الاستجابة السريعة (QR Code)
مولد رمز الاستجابة السريعة (QR Code) للشبكة اللاسلكية
مولد رمز الاستجابة السريعة (QR Code) لمعلومات الاتصال
مُتحقق GTIN
أداة البحث عن رموز البلدان وفقًا لمعيار ISO 3166
إرشادات الإضاءة من IES
باحث ISO 639
بحث يونيكود
توافق ترخيص البرنامج
حاسبة اتفاقية مستوى الخدمة
حاسبة سرعة الجري
حاسبة مؤشر كتلة الجسم
شرح أوامر shell
قاموس إلكتروني
محقق أرقام ضريبة القيمة المضافة
محقق لوهن
محلل ومدقق رقم الحساب المصرفي الدولي (IBAN)
محلل ومنسق رقم الهاتف
محول الأحرف الكبيرة من RMB
محول التقويم
محول العملات
مدقق بطاقات الائتمان
مُحقق ومحلل ISBN
أي يوم؟
إنذار الوقت
إنذار كرون/أيام الأسبوع
العد التنازلي
حاسبة TTL
حاسبة الأيام
حاسبة التاريخ والمدة
حاسبة المدة
حاسبة وقت الوصول المتوقع (ETA)
دمج iCal
محلل ملفات ICAL
محول أرقام الأسبوع
محول المنطقة الزمنية
محول الوقت والتاريخ
مقياس الزمن
مولد ICAL
باسيتو/باسرك المحلية
باسيتو/باسرك عام/خاص
بايتات Niceware إلى عبارة مرور
بيكريبت
تجزئة النص
تشفير / فك تشفير النص
تشفير AGE
تشفير PGP
تشفير RSA
تشفير الملفات باستخدام PGP
تشفير سلسلة Jasypt
حاسبة CRC
فك تشفير Ansible Vault Crypt
محلل JWT
محلل SAML
محلل الشهادة/المفتاح
محول شهادة SSL
مشاركة أسرار شامير
مشفر/مفكك شفرة Bech32
مولد HMAC
مولد JWT
مولد المسؤولية الاجتماعية للشركات
مولد زوج المفاتيح Ed25519
مولد زوج مفاتيح ECDSA
مولد زوج مفاتيح RSA
مولد شهادة X509
مولد مفاتيح PGP
مُوقِّع ومُتحقق RSA/DSA/ECDSA
هاشر Argon2
هاشر الملفات
Json إلى Protobuf
Json إلى SQL INSERT
Stacktrace أجمل
أداة إخفاء جافا سكريبت
أداة إنشاء قواعد البيانات
أداة فك تشفير/فك حزم JavaScript
اختبار واجهة المستخدم Swagger
اختبارات API
تجميل وتنسيق SQL
تحويل Json إلى TypeScript
تمييز الأكواد/البرامج النصية
تنسيق وتصغير ملفات CSS/JS
جهاز اختبار الهروب ANSI
جهاز اختبار بيكوماتش
مؤقت بومودورو
محرر أوامر سطر الأوامر
محول الاقتباس
محول التجعيد
محول ملفات HEX
مزور البيانات
مقسم الملفات
منشئ سلسلة اتصال قاعدة البيانات
مولد Mailto
مولد أسرار جانجو
مولد الرموز المفضلة
مولد تجاهل Git
مولد جداول قواعد البيانات
مولد سمات Gita
مولد علامات Open Graph
مولد معلمات SQL
مولد نصوص اختبار التحميل K6
مُحسِّن جافا سكريبت
مُصغّر SQL
هارب الخيط
IPv4-6/IPRange/CIDR في IPRange/CIDR/IPMask
tools.restic-command-generator.name
tools.url-redirection-checker.name
أداة اختبار الميكروفون
أداة اختبار منافذ TCP/UDP
أداة تنزيل الروابط المتعددة
أرقام المنافذ
اختبار Websocket
استعلامات Cloudflare DNS/RDAP
استعلامات DNS
الأعداد الصحيحة إلى IPv4/IPv6
التحقق من عنوان MAC
بينغ
تحديد الموقع الجغرافي عبر IP
تفويض SIP
جهاز فك تشفير ARPA
حاسبة RAID
حاسبة ZPOOL RAID
حاسبة أمر Chmod
حاسبة استبعاد شبكات IP الفرعية
حاسبة الشبكات الفرعية المرئية
حاسبة الشبكات الفرعية لـ IPv4
حاسبة الشبكة الفرعية IPv6
حاسبة القرص الصلب
حاسبة معدل نقل البيانات
حاسبة موثوقية RAID
حاسبة نطاق IP من CIDR إلى IP الإصدار 4/6
حاسبة نطاق IPv4/6 إلى CIDR(s)
عنوان IP الخاص بي
فك تشفير X-VR-SpamCause
قائمة الشبكات الفرعية IPv4
قوة كلمة المرور Zxcvbn
محلل قوة كلمة المرور
محول Punycode
محول عناوين IPv4
محول عنوان IPv6
محول عنوان MAC
مدقق DNSBL
مدقق Whois
موسع نطاقات IPv4
مولد Apache LogRotate
مولد Crontab
مولد DKIM DNS
مولد DNS BIMI
مولد DNS DMARC
مولد FStab
مولد HTAccess
مولد Htpasswd/htaccess
مولد Iptables
مولد Rsync
مولد SPF DNS
مولد WPA PSK
مولد أوامر Curl
مولد أوامر UFW
مولد أوامر الإيقاف
مولد أوامر جدار الحماية
مولد الخيار 43
مولد تكوين Wireguard
مولد عناوين IPv6 ULA
مولد عناوين MAC
مولد مصادقة أساسية
مولد منفذ عشوائي
مولد نظام أسماء النطاقات PTR
مُحَوِّل أوامر الصدفة
مُنسِّق أوامر الصدفة
مُنسّق Nginx
ورقة الغش ZPool
يحتوي على مطهر
أداة تغيير حجم الصورة
إزالة EXIF
إزالة خلفية الصورة
التعرف الضوئي على الحروف للصور وملفات PDF
تحويل GIF إلى MP4
تحويل الصورة إلى SVG (potrace)
عاكس ألوان الصورة
علامة مائية
قارئ جودة الصور EXIF/Metadata/GPS/JPEG
قص الصورة
محول HEIC
محول ICO/PNG
محول صيغ الصور
مسجل الكاميرا
معاينة ملفات SVG
مقارنة الصور
أداة إنشاء أوامر Nmap
أداة اختبار HTTPS
أداة اختبار انتشار نظام أسماء النطاقات (DNS)
أداة اختبار نظام أسماء النطاقات (DNS)
باحث خصائص LDAP في ActiveDirectory
حاسبة المقاومة
دليل مختصر لتوصيل كابلات RJ45 Cat6
فك تشفير EMV TLV
فك تشفير Outlook Safelink
فك تشفير عنوان URL لمشاركة Sharepoint
فك تشفير معاملات ETH
قارئ ملفات الباركيه
قناع البيانات الحساسة
كاشف نوع الملف
كاشف/فك تشفير مجموعة أحرف النص
محلل MSG في Outlook
محلل البريد الإلكتروني
محلل البريد الإلكتروني المرتد
محلل تقارير DMARC
محلل عنوان URL
محلل ملفات تعريف الارتباط
محول GZip/Deflate
محول SMART Raw
محول أرقام الفاصلة العائمة (float number)
محول الطرف الأوسط
محول ترميز MIME
محول معرف كائن MongoDB
مختبر البكسلات الميتة
مستخرج هوية ندفة الثلج
مشفر/فك تشفير سداسي عشري
معلومات رموز المفاتيح
منشئ عناوين URL
مولد TCPDump
مُوسِّع عناوين URL القصيرة
وحدة التحكم بالمنفذ التسلسلي
键盘测试器
كمبيوتر اللياقة البدنية
محول الإضاءة
محول التردد
محول التسارع
محول السرعة
محول الطاقة
محول بادئات النظام الدولي للوحدات
محول درجات الحرارة
محول طاقة الطعام
محول معدل التدفق الحجمي
محول وحدات الحجم
محول وحدات الزاوية
محول وحدات الضغط
محول وحدات الطاقة
محول وحدات الطول
محول وحدات القوة
محول وحدات الكتلة
محول وحدات المساحة
حاسبة المسافة الجغرافية
حاسبة النسب المئوية
حاسبة نسبة العرض إلى الارتفاع
صانع مقاييس الأداء
Excel إلى البيانات
استهلاك الطاقة ونفقاتها في الكمبيوتر
تحويل CSV إلى بيانات
تحويل الملفات إلى Base64
تحويل نص إلى تمثيله الثنائي في UTF-8
تورنت إلى مغناطيس
محول أحرف Unicode إلى كيانات جافا
محول الأرقام الرومانية
محول الأنظمة العددية
محول الإحداثيات الجغرافية
محول الخصائص
محول الوحدات المتعددة
محول تنسيق متغيرات البيئة
محول ديسيبل ميلي واط
محول وحدة تخزين البيانات
مرمز Base64 للنصوص
مولد ULID
مُشفِّر/فك تشفير مصفوفة سداسية عشرية Base64
مُعَيِّر البريد الإلكتروني
نص إلى الترميز الموحد (Unicode)
محول UUID
مولد الأرقام العشوائية
مولد الاختصارات الرقمية (Numeronym)
مولد الرمز البريدي
مولد الرموز
مولد رمز كلمة مرور لمرة واحدة (OTP)
مولد عبارات مرور BIP39
مولد عبارة المرور
مولد كلمة المرور Diceware
مولد معرفات NanoIDs
مولد معرفات UUIDs
JSON إلى TOON
Unicode إلى GSM-7
أداة البحث عن الخطوط المكررة
أنا و ل تشيكر
إحصائيات النص
اختبار التعابير العادية
استخراج النص من HTML
الصورة إلى فن ASCII
انتقل إلى المسافات باستخدام زر Tab
تحويل TOON إلى JSON
تحويل النص إلى أسماء Unicode
تعتيم سلسلة نصية
حاسبة ليفينشتاين
حزم الملفات للذكاء الاصطناعي
قارئ تأكيد الحضور
كلمات مميزة
مترجم النصوص
محدد سطور عشوائية
محول الرونية
محول القوائم
محول تخطيط لوحة المفاتيح
محول حالة الأحرف
محول شفرة مورس
مخطط هيكل المجلد
مشاركة الروابط الاجتماعية
مصدر حورية البحر
مقارنة الخطوط
مقارنة القوائم
مقارنة النصوص
مقدر رمز GPT
مقسم مطالبات الذكاء الاصطناعي
منتقي الرموز التعبيرية
مولد أوامر Sed
مولد الاستشهادات
مولد نص فني ASCII
مولد نصوص Lorem ipsum
مولد/بانر زالغو
مُستبدل النص الذكي وقاطع الأسطر
مُشفِّر/فك تشفير رمز GPT
مُنسّق Unicode
نص إلى أبجدية الناتو
أنواع الوسائط (MIME types)
الصورة إلى CSS
تحويل HTML إلى XHTML
تحويل HTML إلى بيانات
ترميز/فك ترميز السلاسل النصية بصيغة ترميز عنوان URL
تهريب كيانات HTML (HTML Entities)
تهيئة سلسلة نصية كـ Slug
رموز حالة HTTP
صائد عناوين URL
صانع شظايا بحث نص URL
عجلة الألوان
محرر HTML مرئي
محلل وكيل المستخدم
محول CSS XPath
محول الألوان
محول بكسل REM
محول وحدات CSS
مدقق تباين الألوان
معلومات الجهاز
منظف HTML
منظف عناوين URL
مولد تدرج CSS
مولد صور SVG مؤقتة
مولد عنوان URL لـ UTM
مُجمِّل CSS
مُحسِّن HTML
مُصغّر HTML
HTML إلى Markdown
Markdown Lorem Ipsum
Markdown إلى DOCX
Markdown إلى HTML
Markdown إلى بيانات
tools.markdown-format-converter.name
تحويل Markdown إلى نص
تحويل ملفات epub إلى Markdown
لصق كعلامة Markdown
محرر Markdown
معاينة Markdown
مقارنة ماركداون
مولد جداول Markdown
مولد جدول المحتويات Markdown
مُحسِّن جدول Markdown
منشئ تعبيرات Cron
حاسبة الاستهلاك
التعرف الضوئي على الحروف في الرياضيات
حاسبة الإكراميات
حاسبة ثنائية
محلل رياضي
محول صيغ الرياضيات
مُصوِّر المنحنيات المثلثية/المعادلات
Docker Compose إلى Quadlets
Docker Compose إلى ملف .env
Docker compose إلى kubernetes
برنامج Traefik Docker Compose Maker
برنامج تنزيل صور Docker
تشغيل Docker إلى Kubernetes
تشغيل Docker إلى Quadlets
فحص Docker لتشغيل Docker
محول Docker Compose إلى Docker run
محول أوامر Docker run إلى Docker compose
محول تنسيق Docker Compose
ملصقات دوكر بانغولين
مولد التحكم في الوصول المستند إلى الأدوار (RBAC) في Kubernetes
مولد تسميات Dockerfile
مُحقق Docker Compose
تحويل HTML إلى PDF
تشفير PDF
تنسيق PDF Linearize/FastWeb
ضاغط PDF
فك تشفير وفتح ملفات PDF
مدقق تواقيع PDF
مستخرج صفحات PDF
مستخرج نصوص PDF
مُجمّع ملفات PDF
YAML إلى TOML
اندماج YAML
تجميل وتنسيق YAML
محول YAML إلى JSON
مُسطّح/غير مُسطّح YAML

ورقة غش لقواعد XPath

ورقة غش لقواعد XPath

XPath navigates an XML or HTML document as a tree. Every step has the form axis::node-test[predicate], and most of it has a short form: //div[@class="card"]/a/@href reads “the href of every a inside any div with class card”.

⚠️ Browsers, Selenium and most scrapers implement XPath 1.0. ends-with(), matches(), lower-case() and replace() are 2.0+ and only work in tools like xmllint, Saxon or lxml with an XSLT 2.0 processor. Workarounds for 1.0 are given below.

🧭 Path Syntax

XPathSelects
/From the document root — an absolute path
//Anywhere in the document, at any depth
.The current (context) node
..The parent of the context node
@attrAn attribute
*Any element
@*Any attribute
text()The text nodes of an element
node()Any node at all, text and comments included
[n]The nth match — 1-based, not 0-based
[last()]The last match
a | bThe union of two expressions
/html/body            (: absolute: the body of the page :)
//text()              (: every text node :)
./div/b               (: relative to the context node :)
(//p)[2]              (: the second p in the whole document :)
//p[2]                (: every p that is the second p of its parent :)

🏷 Elements & Attributes

XPathDescriptionCSS
//EEvery <E> elementE
(//E)[2]The second <E> in the document—
//E[@A]<E> carrying attribute AE[A]
//E[@A="t"]<E> where A is exactly tE[A='t']
//E[contains(@A,"t")]<E> where A contains tE[A*='t']
//E[starts-with(@A,"t")]<E> where A starts with tE[A^='t']
//E[substring(@A, string-length(@A)-2)="t"]<E> where A ends with t (1.0 trick)E[A$='t']
//E[ends-with(@A,"t")]The same, XPath 2.0+ onlyE[A$='t']
//E[matches(@A,"r")]A matches regex r (2.0+)—
//E/@AThe value of attribute A—
//*/@AAttribute A of any element—
//E[@A2="t"]/@A1A1 where A2 is t—
//E1[@id="I1"] | //E2[@id="I2"]Either elementE1#I1, E2#I2
//E[@id="I1" or @id="I2"]<E> with either idE#I1, E#I2

🆔 Id, Name, Class & Language

XPathDescriptionCSS
//*[@id="I"]The element with id I#I
//E[@id="I"]<E> with id IE#I
//*[@name="N"]Any element named N[name='N']
//*[@name="N"][@value="v"]Named N with value v[name='N'][value='v']
//*[contains(concat(" ", normalize-space(@class), " "), " C ")]Element with class C — the padding avoids matching C2.C
//E[contains(concat(" ", normalize-space(@class), " "), " C ")]<E> with class CE.C
//E[@lang="L" or starts-with(@lang, concat("L","-"))]<E> in language L or a subcodeE[lang|='L']

📝 Text & Links

XPathDescriptionCSS
//*[.="t"]Element whose whole text is exactly t—
//E[contains(text(),"t")]<E> with a text node containing t—
//E[contains(.,"t")]<E> whose text, descendants included, contains t—
//E[normalize-space()="t"]Exact text, ignoring surrounding whitespace—
//aEvery linka
//a[.="t"]The link labelled exactly t—
//a[@href="url"]The link pointing at urla[href='url']
//a[.="t"]/@hrefThe URL behind the label t—
//a[starts-with(@href,"https")]Secure links onlya[href^='https']

👪 Parents & Children

XPathDescriptionCSS
//E/*[1]First child of <E>E > *:first-child
//E/*[last()]Last child of <E>E > *:last-child
//E[1]Each <E> that is the first of its type in its parentE:first-of-type
//E[last()]Last <E> of its typeE:last-of-type
//E[2]Second <E> of its typeE:nth-of-type(2)
//*[2][name()="E"]Second child, if it is an <E>E:nth-child(2)
//E[last()-1]Second-to-last <E> of its typeE:nth-last-of-type(2)
//E/..The parent of <E>—
//div/form/parent::*Every element that has a form childdiv:has(> form)
//*[@id="I"]//E<E> anywhere under id I#I E
//E[count(*)=0]<E> with no element childrenE:empty
//E[count(*)=1]<E> with exactly one child—
//E[count(preceding-sibling::*)+count(following-sibling::*)=0]<E> that is an only childE:only-child
//E[count(../E)=1]<E> with no <E> siblingsE:only-of-type
//E1[E2 and not(*[not(self::E2)])]<E1> whose only children are <E2>—
//E[position() mod N = M + 1]Every Nth element, offset by ME:nth-child(Nn+M)

👥 Siblings

XPathDescriptionCSS
//E2/following-sibling::E1Every <E1> after a sibling <E2>E2 ~ E1
//E2/following-sibling::*[1][name()="E1"]<E1> immediately after <E2>E2 + E1
//E2/following-sibling::*[2][name()="E1"]<E1> two siblings after <E2>E2 + * + E1
//E/following-sibling::*[1]Whatever follows <E> directlyE + *
//E2/preceding-sibling::E1Every <E1> before a sibling <E2>—
//E2/preceding-sibling::*[1][name()="E1"]<E1> immediately before <E2>—
//E/preceding-sibling::*[1]Whatever precedes <E> directly—

📊 Tables & Form State

XPathDescriptionCSS
//*[@id="T"]//tr[3]//td[2]Third row, second cell#T tr:nth-child(3) td:nth-child(2)
//td[preceding-sibling::td="t"]The cell right after the one reading t—
//td[preceding-sibling::td[contains(.,"t")]]Cells following one containing ttd:has(~ td)
//table[count(tr)=1 and count(tr/td)=2]Tables with one row and two columns—
//table/tr[last()]The last row of a tabletable tr:last-child
//E[@disabled]A disabled controlE:disabled
//E[not(@disabled)]A control that is not disabledE:enabled
//*[@checked]A checked checkbox or radio:checked

🧮 Functions

Strings

FunctionReturns
contains(haystack, needle)True when the first string contains the second
starts-with(haystack, needle)True when it starts with it
concat(s1, s2, …)The strings joined together
normalize-space(s)The string with runs of whitespace collapsed and trimmed
string-length(s)The number of characters
substring(s, start [, length])A slice — 1-based
substring-before(haystack, needle)Everything before the first occurrence
substring-after(haystack, needle)Everything after it
translate(s, from, to)Characters mapped one by one — the 1.0 way to fold case

Numbers, logic & nodes

FunctionReturns
count(node-set)How many nodes matched
sum(node-set)The sum of their numeric values
position()The index of the context node within its step
last()The size of the context — so [last()] is the final node
name([node-set])The qualified name of the first node
namespace-uri([node-set])Its namespace URI
lang(s)True when the node is in that language
not(expr)The negation
true() / false()Boolean constants
boolean(expr) / string(o) / number(o)Type conversions
ceiling(n) / floor(n) / round(n)Rounding

💡 Case-insensitive matching in XPath 1.0: //E[contains(translate(@A,"ABCDEFGHIJKLMNOPQRSTUVWXYZ","abcdefghijklmnopqrstuvwxyz"), "t")]

🧭 Axes

AxisShort formSelects
child(default)The direct children of the context node
descendant//Every node below the context node
descendant-or-self//The context node and everything below it
parent..The single parent node
ancestor—Parent, grandparent, up to the root
ancestor-or-self—The same, including the context node
following—Everything after the node in document order, except descendants
following-sibling—Later siblings under the same parent
preceding—Everything before it, except its ancestors
preceding-sibling—Earlier siblings under the same parent
attribute@The attributes of the node
self.The context node itself
//td[.="Total"]/ancestor::table          (: the table a cell belongs to :)
//h2[.="Specs"]/following-sibling::ul[1] (: the list after a heading :)
//input[@name="q"]/ancestor-or-self::form (: the form wrapping a field :)

🧠 Worked Examples

//hr[@class="edge" and position()=1]
(: the first hr of class 'edge' under each parent :)

//table[parent::div[@class="pad"] and not(@id)]//a
(: links in unnamed tables inside a padded div :)

/html/body/div/*[preceding-sibling::h4]
(: whatever comes after an h4 :)

//tr/td[font[@class="head" and text()="TRACK"]]
(: cells whose font child says TRACK :)

//*[count(*)=3]
(: elements with exactly three children :)

//rdf:Seq/rdf:li/em:id
(: namespaced elements — the prefixes must be bound by the host tool :)

//var | //acronym
(: a union of two node sets :)

🛠 Running XPath

// browser devtools console
$x('//a[contains(@href, "docs")]');

// plain DOM API
document.evaluate('//h1', document, null, XPathResult.ANY_TYPE, null).iterateNext();
# from the shell, over XML or HTML
xmllint --xpath '//book/title/text()' catalog.xml
xmllint --html --xpath '//a/@href' page.html 2>/dev/null
from lxml import html
tree = html.parse('page.html')
tree.xpath('//div[@class="card"]/a/@href')
# Selenium and Playwright both accept XPath locators
driver.find_element(By.XPATH, '//button[normalize-space()="Save"]')
page.locator('xpath=//button[normalize-space()="Save"]').click()

⚠️ Notes

  • Indexes start at 1. [0] never matches anything.
  • //E[1] is per-parent, (//E)[1] is document-wide — the single most common XPath bug.
  • Namespaced documents need prefixes registered with the host library; in XPath 1.0 a common workaround is //*[local-name()="title"].
  • // is expensive on large documents; anchor the path when you can.
  • Prefer text matching with normalize-space() — HTML is full of stray whitespace and line breaks.

📚 Resources

  • MDN — XPath
  • MDN — XPath functions
  • XPath 1.0 specification
  • XPath cheat sheet (alephzarro)

Credit to the original author: https://gist.github.com/jmaccabee/550a0b9fcfdc7e6b170cd34c6ec7bc56