Y
Y
Yevgeni2018-05-20 13:46:08
Python
Yevgeni, 2018-05-20 13:46:08

Unable to click on element. How to do it?

Task: click on the link and get a phone number.
I tried to search for an element by xpath but all to no avail.
I would be very happy and grateful if someone can help me solve this problem.

def get_phone_number(url):
    driver2.get(url)
    show = driver2.find_element_by_link_text('Показать номер')
    show.click()

   
    number = driver2.find_element_by_id('ptd2_1')

    print(number.text)


get_phone_number(
    'https://www.ss.com/msg/ru/work/are-required/barman/hglbd.html')

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question