Issue
I'm scraping a page with some divs with the id = Content_Main_ some random number but can't get their content using the following xpath because the result is always empty, what I'm doing wrong?
//div[re:test(@id, '([Content_Main_]+\d{5}[0-9])')]
/div[@id='Content_Main_4']
/div[@id='Content_Main_5']
/div[@id='Content_Main_8']
Solution
I think you need something like (starting with Content_Main_
and next a digit
):
//div[re:test(@id, 'Content_Main_\d+')]
UPDATE
To select div
s ending with a number you need:
//div[re:test(@id, 'Content_Main_\d+$')]
Answered By - gangabass
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.