-1

enter image description here

can someone translate this into python code so, for example, I know the first and second line will be

driver.get("link im using")
driver.set_window_size(945, 757)

I just can't figure out the rest

Norayr Sargsyan
  • 1,737
  • 1
  • 12
  • 26
Eslam Ali
  • 31
  • 5

2 Answers2

0

The equivalent code for:

SelenCommands

will be:

driver.get("link im using")
driver.set_window_size(945, 757)
driver.switch_to.frame(1)
driver.find_element_by_css_selector(".tg-join > span").click()

Reference

You can find a couple of relevant discussions in:

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • isnt that equivalent to `index=1`then `driver.switch_to_frame(index)` if so that didnt work it said it couldnt find the index – Eslam Ali Nov 23 '20 at 11:31
  • @EslamAli We don't have a visibility either to your usecase or the relevant HTML. This answer is a simple conversion of _Selenoid_ commands for which you have provided an snapshot into equivalent Selenium Python client commands. Nothing much. This should help you to get started. See the references as well. Try out the solution and let me know the status. – undetected Selenium Nov 23 '20 at 11:37
  • is there a way i can inspect element and look at the frames available in a page or like what frame i am on currently? – Eslam Ali Nov 23 '20 at 11:47
  • @EslamAli To inspect element and look at the frames available in a page you can follow [this](https://stackoverflow.com/questions/59365968/opening-inspect-pressing-f12-on-chrome-via-selenium/59369763#59369763), [this](https://stackoverflow.com/questions/63034593/chrome-devtools-not-find-elements-not-search/63035359#63035359) or [this](https://stackoverflow.com/questions/54589156/how-to-open-chrome-browser-console-through-selenium/54592918#54592918) discussion. – undetected Selenium Nov 23 '20 at 11:56
-1

to select a frame you can use

driver.switch_to_frame()

to click on an item you can use

driver.find_element_by_xpath().click()

to switch to a window

driver.switch_to_window()
Ahmed Yasser
  • 109
  • 12
  • thats what i did for switching the frame but it didnt work i did this `index=1`then `driver.switch_to_frame(index)` but it didnt work – Eslam Ali Nov 23 '20 at 11:22