How to identify and switch to the frame source in Selenium?
<p>I have been using the Selenium and Python2.7, on Firefox.</p>

<p>I would like it to work like the following, but I do not know how to write code.</p>

<pre><code>Driver.get('https://video-download.online')
Url='https://www.youtube.com/watch?v=waQlR8W8aTA'
Driver.find_element_by_id("link").send_keys(Url)
Driver.find_element_by_id("submit").click()
time.sleep(5)
#[Click]lowermost(highest quality) radio button
#[Click]Proceed button
</code></pre>

<p>You are able to get frame locator value in HTML code which is specified in iframes tag. u can move up from where your locator value is existed in HTML code.</p>

<p>This function is suitable:</p>

<pre><code>def frame_switch(css_selector):
  driver.switch_to.frame(driver.find_element_by_css_selector(css_selector))
</code></pre>

<p>If you are just trying to switch to the frame based on the <code>name</code> attribute, then you can use this:</p>

<pre><code>def frame_switch(name):
  driver.switch_to.frame(driver.find_element_by_name(name))
</code></pre>

python selenium firefox