K
K
Kirill Petrov2017-01-02 12:00:14
Python
Kirill Petrov, 2017-01-02 12:00:14

How to search through xpatch+ regular expressions?

All with the coming!
Can't get element for python+selenium script. How to find this element?

1483346727727127-tokenfield
numbers are dynamic.Thanks
<input class="token-input tt-input" autocomplete="off" placeholder="To" id="1483346727727127-tokenfield" tabindex="1" style="min-width: 60px; width: 390px; position: relative; vertical-align: top; background-color: transparent;" spellcheck="false" dir="auto" type="email">

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Z
Zelimkhan Beltoev, 2017-01-02
@dandyvssega

And what's the problem with searching by class?
If xpath then:
//input[@class="token-input tt-input"]

A
Alexey, 2017-01-02
@Toximiner

More specifically, then
or
But if, nevertheless, you want xpath, then

driver.find_element_by_xpath('//input[@class="token-input tt-input"]')

B
Bjornie, 2017-01-02
@Bjornie

By default, chrome has a copy xpath button in the inspector. Try it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question