-1
I created a script in Python using Selenium to access a site and download some files, however, the browser blocks the download and informs the following message: "Could not download - No permissions". Note: I don’t have an Adm account on the computer I run, but the lock only happens when I use Selenium. If I open the browser manually the downloads are done normally.
Is there an adjustment option in the code to handle this download lock (for example, some option in "Options")? Below is a part of the code as an example, but the permission error happens on any page/site.
def baixa_relacao():
options = EdgeOptions()
options.use_chromium = True
driver = Edge(options=options)
actionChains = ActionChains(driver)
driver.get('confidencial')
driver.find_element_by_xpath('//*[@id="gsft_nav"]/div/magellan-favorites-list/ul/li[1]/div/div[1]/a/div[2]/span').click()
driver.switch_to.frame('gsft_main')
driver.find_element_by_link_text('Enviar Segurado...').click()
botao = driver.find_element_by_xpath('//*[@id="hdr_sc_req_item"]/th[5]/span/a')
actionChains.context_click(botao).perform()
driver.find_element_by_xpath('//*[@id="context_list_headersc_req_item"]/div[13]').click()
driver.find_element_by_xpath('//*[@id="d1ad2f010a0a0b3e005c8b7fbd7c4e28_sc_req_item"]/div[2]').click()
driver.find_element_by_id('download_button').click()
You already asked that question here cannot answer without knowing which page that code is intended for.
– Augusto Vasques
Regardless of the page, it blocks the download. That is, if the script joins google and tries to download something, it will give the same permission problem. I’ve tried it on several pages. The above code was just one of the example pages.
– Filipe Martins
But as so page independent, the xpath is very specific it can only be applied to the tree whose was designed.
– Augusto Vasques
The code I put above is just a part of the script that accesses a particular website and downloads a file. The script accesses other pages on the internet also to download other files. Regardless of the site or browser I use I can’t download any file and I get the message "No permissions". I’ve even tried to change the folder where downloads are saved, but also without success.
– Filipe Martins