0

I'm stuck on a very simple part of a selenium script that should take me 5 seconds.

<input type="text" placeholder="000-000-0000" name="phoneNumber" 
class="ew6td2426 css-1p641ex ejlqu6x14" value="">

there are multiple elements with the name phoneNumber, but i just want to grab the first one, which is here.

when i grab the xpath, it gives me this


//*[@id="js-global-container"]/main/div[1]/div[2]/div/div/div/div[1]/div/form/input


placing it into the script as this

driver.find_element_by_xpath("//*[@id='js-global- 
container']/main/div[1]/div[2]/div/div/div/div[1]/div/form/input")

but again, the script says it cannot find the method.

does anyone have an easy fix for this? I cant figure this out and its driving me insane

jkorn95
  • 45
  • 6

1 Answers1

0

Try switching frames:

driver.switch_to.frame('find your frame element here with driver.find')

For switching back:

driver.switch_to.default_content()
Monolith
  • 1,067
  • 1
  • 13
  • 29
soswxc
  • 1
  • 1