You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say you want to combine the page title /html/head/title/text()
with text form another element, like: /html/body/div[1]/div[1]/div[1]/main/div[1]/div[1]/div[3]/section/section/section/section/div[1]/section/div[1]/button/div/span[2]/text()
Well, you can do this: concat(/html/head/title/text(), ' - ', /html/body/div[1]/div[1]/div[1]/main/div[1]/div[1]/div[3]/section/section/section/section/div[1]/section/div[1]/button/div/span[2]/text())
Whatever is inside the single quotes will become the separator between both elements, in this example is ' - ' (space, hypen, space). However, beware that if the filename is too long, it will be trimmed to the "Max filename length" defined in settings.
You can also combine concat with this to remove unwanted characters, so the final result could be something like: translate(concat(/html/head/title/text(), ' - ', /html/body/div[1]/div[1]/div[1]/main/div[1]/div[1]/div[3]/section/section/section/section/div[1]/section/div[1]/button/div/span[2]/text()), '/\?*:"<>|', '')
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Your question
Let's say you want to combine the page title
/html/head/title/text()
with text form another element, like:
/html/body/div[1]/div[1]/div[1]/main/div[1]/div[1]/div[3]/section/section/section/section/div[1]/section/div[1]/button/div/span[2]/text()
Well, you can do this:
concat(/html/head/title/text(), ' - ', /html/body/div[1]/div[1]/div[1]/main/div[1]/div[1]/div[3]/section/section/section/section/div[1]/section/div[1]/button/div/span[2]/text())
Whatever is inside the single quotes will become the separator between both elements, in this example is ' - ' (space, hypen, space). However, beware that if the filename is too long, it will be trimmed to the "Max filename length" defined in settings.
You can also combine concat with this to remove unwanted characters, so the final result could be something like:
translate(concat(/html/head/title/text(), ' - ', /html/body/div[1]/div[1]/div[1]/main/div[1]/div[1]/div[3]/section/section/section/section/div[1]/section/div[1]/button/div/span[2]/text()), '/\?*:"<>|', '')
Addon & CoApp version and details
No response
Beta Was this translation helpful? Give feedback.
All reactions