I'm using selenium to navigate a webpage with the aim of retrieving the source url of a pdf so I can download it. I've been able to log onto the website and go the the page where the pdf loads, but I'm having problems getting the url as it's embedded. I'm not a programmer or anything so please forgive any lack of details. The code I have is:

```
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options

import time

PATH = "C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(PATH)
myUsername="xxxx"
myPassword="xxxx"
driver.get("www.xxxxxx.com")

#login
driver.find_element_by_xpath("//*[@id='tbUserName']").send_keys(myUsername);
driver.find_element_by_xpath("//*[@id='tbPassword']").send_keys(myPassword);
driver.find_element_by_xpath("//*[@id='ctl00_cp_Content_spLogin']").click()
time.sleep(2)

#select report
driver.get("www.xxxxxx.com")
driver.find_element_by_xpath("//*[@id='Repeater_ReportCategory_ctl00_LinkButton_ReportCategory']").click()
time.sleep(2)

# //*[@id="Repeater_QuizType_ctl00_LinkButton_QuizTypeLink"]
driver.find_element_by_xpath("//*[@id='Repeater_AdditionalReports_ctl06_LinkButton_AdditionalReportName']").click()
time.sleep(2)

#sort the report options
driver.find_element_by_xpath("//*[@id='RadioButton_WordCountSortByWCHighToLow']").click()
driver.find_element_by_xpath("//*[@id='mButton_Next']").click()
time.sleep(2)

#get the pdf url
mydata = driver.switch_to.frame("mBottomFrame").get_attribute("src")
print("url: ",mydata)

```

When I am at the page I want, the pdf file is embedded. When I inspect the embedded pdf, the details I get are:

```
<embed id="plugin" type="application/x-google-chrome-pdf" src="https://z11reports.renlearn.co.uk/JSRPT0238PR/jsfileserver/reports/1125/f06db71a2a424474bad540778d952816.pdf" stream-url="chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/5224347f-1444-4cbe-8eba-603149c683c0" headers="Cache-Control: private
    Content-Length: 12574
    Content-Type: application/pdf
    Date: Fri, 19 Feb 2021 11:27:06 GMT
    Server: Microsoft-IIS/8.5
    X-AspNet-Version: 4.0.30319
    X-Powered-By: ASP.NET
    " background-color="0xFF525659" top-toolbar-height="56" javascript="allow" top-level-url="undefined">

```

When I inspect the page outside of the embeded pdf I get (I read as it was in a frame i need to modify the code which I did):

```
<frameset id="mFrameset" rows="85,*" framespacing="0" style="border:0px;" frameborder="yes" onload="ResizeWindow()">
<frame id="mTopFrame" style="margin:0px;" scrolling="no" src="ReportsController.rli?OK=70ef071f-29ed-4b3e-8fb9-ebaa02297e6e">
<frame id="mBottomFrame" style="margin:0px;" scrolling="auto" src="https://z11reports.renlearn.co.uk/JSRPT0233PR/jsfileserver/reports/1105/6dc259000b5c469283e8ab41ca151c21.pdf" cd_frame_id_="cca6f2eb4da021471005d2ad897038a5">
<noframes>
<body>
<p>
This page uses frames, but your browser doesn't support them.
</p>
</body>
</noframes>
</frameset>

```

I want to retrieve the source url of the pdf which is displayed on both of these bit of code (which won't be there anymore, they seem to delete shortly after being run). When I run my code I get the error:

```
Traceback (most recent call last):
  File "c:/Users/me/Documents/emailreport/emailreport.py", line 33, in <module>
    mydata = driver.switch_to.frame("mBottomFrame").get_attribute("src")
  File "C:\Users\aoifereid7\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\switch_to.py", line 87, in frame
    raise NoSuchFrameException(frame_reference)
selenium.common.exceptions.NoSuchFrameException: Message: mBottomFrame

```

Any help would be greatly appreciated as I've been working for hours and this and have gotten nowhere, thanks