Find nodes containing string split over 2 tagsFind position of a node using xpathHow to find out an element node with a empty string value in xslxpath find if node existsHow can I match on an attribute that contains a certain string?XPath contains(text(),'some string') doesn't work when used with node with more than one Text subnodeWrapping an XML element with its ancestor nodes/tagsXPath to find nodes with text + all their descendants & siblings that match certain criteriaHTML Agility pack + Select node by its inner textIterating over child nodes in XML file with JavaScript using XPathProcessing html text nodes with scrapy and XPath
Could a US citizen born through "birth tourism" become President?
Locked-up DOS computer beeped on keypress. What mechanism caused that?
Which modern firearm should a time traveler bring to be easily reproducible for a historic civilization?
Will the internet speed decrease on second router if there are multiple devices connected to primary router?
Why does a tetrahedral molecule like methane have a dipole moment of zero?
When designing an adventure, how can I ensure a continuous player experience in a setting that's likely to favor TPKs?
How to extract interesting piece of output in bash
Why are flying carpets banned while flying brooms are not?
Enumerate list with each item in a new row
Why can't I hear fret buzz through the amp?
Why do jet engines sound louder on the ground than inside the aircraft?
Is Tales of Old an official bard ability?
Apex Legends stuck at 60 FPS (G-Sync 144hz monitor)
Why don't humans perceive waves as twice the frequency they are?
How would you say "Sorry, that was a mistake on my part"?
Diagram of Methods to Solve Differential Equations
How did Jayne know when to shoot?
How can I automate this tensor computation?
What is the name for the average of the largest and the smallest values in a given data set?
Why isn't a binary file shown as 0s and 1s?
Why did my "seldom" get corrected?
How can I help our ranger feel special about her beast companion?
Can error correction and detection be done without adding extra bits?
Why is Google approaching my VPS machine?
Find nodes containing string split over 2 tags
Find position of a node using xpathHow to find out an element node with a empty string value in xslxpath find if node existsHow can I match on an attribute that contains a certain string?XPath contains(text(),'some string') doesn't work when used with node with more than one Text subnodeWrapping an XML element with its ancestor nodes/tagsXPath to find nodes with text + all their descendants & siblings that match certain criteriaHTML Agility pack + Select node by its inner textIterating over child nodes in XML file with JavaScript using XPathProcessing html text nodes with scrapy and XPath
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
is there a way to get nodes containing a specific string which is split over 2 tags. I tried this but it doesn't work. I can't manage to ignore foreign tag.
$crawler->filterXPath('//p/text()[contains(., "caractère a priori")]');
<p>leur caractère <foreign xml:lang="lat">a priori</foreign>, soit..</p>
Thanks a lot !
xpath
add a comment |
is there a way to get nodes containing a specific string which is split over 2 tags. I tried this but it doesn't work. I can't manage to ignore foreign tag.
$crawler->filterXPath('//p/text()[contains(., "caractère a priori")]');
<p>leur caractère <foreign xml:lang="lat">a priori</foreign>, soit..</p>
Thanks a lot !
xpath
Is your expected outputleur caractère a priori soit?
– Jack Fleeting
Mar 26 at 13:01
Dont know what output I want yet. Anyway, Dan Gardner answer seems to work !
– arnaudbey
Mar 26 at 14:50
add a comment |
is there a way to get nodes containing a specific string which is split over 2 tags. I tried this but it doesn't work. I can't manage to ignore foreign tag.
$crawler->filterXPath('//p/text()[contains(., "caractère a priori")]');
<p>leur caractère <foreign xml:lang="lat">a priori</foreign>, soit..</p>
Thanks a lot !
xpath
is there a way to get nodes containing a specific string which is split over 2 tags. I tried this but it doesn't work. I can't manage to ignore foreign tag.
$crawler->filterXPath('//p/text()[contains(., "caractère a priori")]');
<p>leur caractère <foreign xml:lang="lat">a priori</foreign>, soit..</p>
Thanks a lot !
xpath
xpath
asked Mar 26 at 10:38
arnaudbeyarnaudbey
6049 silver badges18 bronze badges
6049 silver badges18 bronze badges
Is your expected outputleur caractère a priori soit?
– Jack Fleeting
Mar 26 at 13:01
Dont know what output I want yet. Anyway, Dan Gardner answer seems to work !
– arnaudbey
Mar 26 at 14:50
add a comment |
Is your expected outputleur caractère a priori soit?
– Jack Fleeting
Mar 26 at 13:01
Dont know what output I want yet. Anyway, Dan Gardner answer seems to work !
– arnaudbey
Mar 26 at 14:50
Is your expected output
leur caractère a priori soit?– Jack Fleeting
Mar 26 at 13:01
Is your expected output
leur caractère a priori soit?– Jack Fleeting
Mar 26 at 13:01
Dont know what output I want yet. Anyway, Dan Gardner answer seems to work !
– arnaudbey
Mar 26 at 14:50
Dont know what output I want yet. Anyway, Dan Gardner answer seems to work !
– arnaudbey
Mar 26 at 14:50
add a comment |
1 Answer
1
active
oldest
votes
The below XPath should work for you, it will return only <p> nodes which contain the text specified in the contains statement. I've expanded the example a bit, for me to test, and included a fiddle here.
XPath:
div/p[contains(., 'caractère a priori')]
Input
<div>
<p>leur caractère <foreign xml:lang="lat">a priori</foreign>, soit..</p>
<p>leur poisson <foreign xml:lang="lat">a priori</foreign>, soit..</p>
</div>
Output
<p>leur caractère <foreign xml:lang="lat">a priori</foreign>, soit..</p>
Hopefully that give you enough to go on!
working like a charm, thanks ;)
– arnaudbey
Mar 26 at 14:51
@arnaudbey Perfect, glad it worked! :)
– Dan Gardner
Mar 26 at 14:51
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55355070%2ffind-nodes-containing-string-split-over-2-tags%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The below XPath should work for you, it will return only <p> nodes which contain the text specified in the contains statement. I've expanded the example a bit, for me to test, and included a fiddle here.
XPath:
div/p[contains(., 'caractère a priori')]
Input
<div>
<p>leur caractère <foreign xml:lang="lat">a priori</foreign>, soit..</p>
<p>leur poisson <foreign xml:lang="lat">a priori</foreign>, soit..</p>
</div>
Output
<p>leur caractère <foreign xml:lang="lat">a priori</foreign>, soit..</p>
Hopefully that give you enough to go on!
working like a charm, thanks ;)
– arnaudbey
Mar 26 at 14:51
@arnaudbey Perfect, glad it worked! :)
– Dan Gardner
Mar 26 at 14:51
add a comment |
The below XPath should work for you, it will return only <p> nodes which contain the text specified in the contains statement. I've expanded the example a bit, for me to test, and included a fiddle here.
XPath:
div/p[contains(., 'caractère a priori')]
Input
<div>
<p>leur caractère <foreign xml:lang="lat">a priori</foreign>, soit..</p>
<p>leur poisson <foreign xml:lang="lat">a priori</foreign>, soit..</p>
</div>
Output
<p>leur caractère <foreign xml:lang="lat">a priori</foreign>, soit..</p>
Hopefully that give you enough to go on!
working like a charm, thanks ;)
– arnaudbey
Mar 26 at 14:51
@arnaudbey Perfect, glad it worked! :)
– Dan Gardner
Mar 26 at 14:51
add a comment |
The below XPath should work for you, it will return only <p> nodes which contain the text specified in the contains statement. I've expanded the example a bit, for me to test, and included a fiddle here.
XPath:
div/p[contains(., 'caractère a priori')]
Input
<div>
<p>leur caractère <foreign xml:lang="lat">a priori</foreign>, soit..</p>
<p>leur poisson <foreign xml:lang="lat">a priori</foreign>, soit..</p>
</div>
Output
<p>leur caractère <foreign xml:lang="lat">a priori</foreign>, soit..</p>
Hopefully that give you enough to go on!
The below XPath should work for you, it will return only <p> nodes which contain the text specified in the contains statement. I've expanded the example a bit, for me to test, and included a fiddle here.
XPath:
div/p[contains(., 'caractère a priori')]
Input
<div>
<p>leur caractère <foreign xml:lang="lat">a priori</foreign>, soit..</p>
<p>leur poisson <foreign xml:lang="lat">a priori</foreign>, soit..</p>
</div>
Output
<p>leur caractère <foreign xml:lang="lat">a priori</foreign>, soit..</p>
Hopefully that give you enough to go on!
edited Mar 27 at 16:27
answered Mar 26 at 11:56
Dan GardnerDan Gardner
2133 silver badges14 bronze badges
2133 silver badges14 bronze badges
working like a charm, thanks ;)
– arnaudbey
Mar 26 at 14:51
@arnaudbey Perfect, glad it worked! :)
– Dan Gardner
Mar 26 at 14:51
add a comment |
working like a charm, thanks ;)
– arnaudbey
Mar 26 at 14:51
@arnaudbey Perfect, glad it worked! :)
– Dan Gardner
Mar 26 at 14:51
working like a charm, thanks ;)
– arnaudbey
Mar 26 at 14:51
working like a charm, thanks ;)
– arnaudbey
Mar 26 at 14:51
@arnaudbey Perfect, glad it worked! :)
– Dan Gardner
Mar 26 at 14:51
@arnaudbey Perfect, glad it worked! :)
– Dan Gardner
Mar 26 at 14:51
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55355070%2ffind-nodes-containing-string-split-over-2-tags%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Is your expected output
leur caractère a priori soit?– Jack Fleeting
Mar 26 at 13:01
Dont know what output I want yet. Anyway, Dan Gardner answer seems to work !
– arnaudbey
Mar 26 at 14:50