0

enter image description here

I want to find the phone number from these websites with XPath.

I tried with

//*[starts-with(text(),’+49’)]

and other similar combinations but it doesn't work. Anyone who can give me some advice?

kjhughes
  • 106,133
  • 27
  • 181
  • 240
Bao Hoang
  • 53
  • 3
  • 2
    You should add HTML-sample as text not as picture. You might also specify the programming language and web-scraping tool that you're using – JaSON Jun 06 '22 at 11:40
  • I've answered your question this time, but @JaSON is correct: Please post a [mcve] that allows us to test solutions against HTML or XML posted as text, formatted as code -- never posted as an image. Thank you. – kjhughes Jun 06 '22 at 13:02
  • Don't say that it "doesn't work". Tell us how it fails. – Michael Kay Jun 06 '22 at 14:37

1 Answers1

1

This XPath,

//text()[starts-with(normalize-space(), '+49')]

will select all text nodes with a space-normalized string value that starts with '+49', as requested.

See also

kjhughes
  • 106,133
  • 27
  • 181
  • 240