0
votes

New to selenium and this is my sample project.

I have a element inside of a div that I cant access, I have tried searching for answers but only found java code. As I am new to selenium I am using the Table way of making my tests.

I found this answer:

You can use cssSelector,

driver.switchTo().frame(driver.findElement(By.cssSelector("iframe[title='Fill Quote']")));

But there is no command called driver.

Sorry if this sounds stupid but my only wish is to learn!

1

1 Answers

1
votes

The 'driver' here is an instance standing for browser.
And you are finding elements by: browser.find_element_by...()

The steps of using selenium is actually same as the steps that you manually find elements on browser:

  1. open a browser and enter URL
from selenium import webdriver

driver = webdriver.Firefox()
driver.get("http://www.python.org")
  1. find elements by either id, class, tag or compound of them:
elem = driver.find_element_by_css_selector("iframe[title='Fill Quote']")

Here is a doc for selenium of python.