<div id="content-body-14269002-17290547">
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
</div>
I Need To Select Everything in id = "content-body*"
content-body changes on every Page, May Be Need to Use Wildcards ?
<div id="content-body-14269002-17290547">
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
</div>
I Need To Select Everything in id = "content-body*"
content-body changes on every Page, May Be Need to Use Wildcards ?
Probably xpath search for divs where the id contains specific text Duplicate
Anyways,
For IDs
//div[contains(@id,"content-body")]//p #to Select all Paragraphs
//div[contains(@id,"content-body")]//p//text() # To Select all text in Paragraphs
For Classes
//*[contains(@class,"content-body")//p
//div[contains(@class,"content-body")]//p//text()
For Class in Class
//*[contains(@class,"content-body") and contains(@class,"another-sub-content-body")]//p//text()
Hope it Helps !!!
//div[contains(@id, "content-body")]
This means content-body
in content-body-14269002-17290547
Normally, this will works.
Better:
//div[starts-with(@id, "content-body")]
This means the id attribute's value is started with content-body