1

I want to get the mobile number of companies from this website, but the mobile number is stored in a weird format that I haven't seen before. Each span represent each digit of the mobile number.

The url of the website is 'https://www.justdial.com/Bangalore/Corporate-Companies-in-Manyata-Tech-Park/nct-10138533'.

The picture I added isn't showing up for some reason 'https://i.stack.imgur.com/AcaGs.jpg'

Revanth MK
  • 11
  • 3

2 Answers2

0

You would need to use JavaScript to access the pseudo element ::before. You can look at this answer here and try modifying it: https://stackoverflow.com/a/43892892/4323004

browser.execute_script("return window.getComputedStyle(document.querySelector('.SomeTitle .bar'),':before').getPropertyValue('content')")

Lorn
  • 194
  • 1
  • 5
0

You can use the the core function from WebDriver.findElements. Pass to this the xpath: "identify_parent_spans/span" where 'identify_parent_span is the xpath for identify the node where the phone number is located. After have the array of spans iterate over it and execute getText for each element and build the phoneNumber string.