Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Login to website
#5
It didnt work to accept alert

Quote:NoAlertPresentException: No modal dialog is currently open

But I found the box:

<div id="cadboxClose" class="">close</div>
And now it closes:

driver.find_element_by_id("cadboxClose").click()

Almost there! Now Firefox shows the dialog to start downloading, and it has to be dismissed manually. I added the following code to prevent the dialog from coming up, but probably I give it the wrong content type. How do I find out what content type the downloaded file is?

profile = webdriver.FirefoxProfile()
profile.set_preference("browser.helperApps.neverAsk.openFile", "text/csv")
profile.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/csv")
profile.set_preference("browser.helperApps.alwaysAsk.force", False);
profile.set_preference("browser.download.manager.showWhenStarting",False)
profile.set_preference("browser.download.manager.useWindow", False);
profile.set_preference("browser.download.manager.focusWhenStarting", False);
profile.set_preference("browser.download.manager.alertOnEXEOpen", False);
profile.set_preference("browser.download.manager.showAlertOnComplete", False);
profile.set_preference("browser.download.manager.closeWhenDone", True);
profile.set_preference("pdfjs.disabled", True);

profile.set_preference("browser.download.dir", '/home/justme/downloads/')
profile.set_preference("browser.download.folderList", 2)
Reply


Messages In This Thread
Login to website - by kapibara - Jul-26-2019, 06:47 AM
RE: Login to website - by metulburr - Jul-26-2019, 10:50 AM
RE: Login to website - by kapibara - Jul-27-2019, 03:23 AM
RE: Login to website - by metulburr - Jul-27-2019, 11:20 AM
RE: Login to website - by kapibara - Jul-27-2019, 02:40 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Login and download an exported csv file within a ribbon/button in a website Alekhya 0 2,686 Feb-26-2021, 04:15 PM
Last Post: Alekhya
  Get element (ID) from website to login Olimpiarob 4 4,314 Jul-28-2020, 01:20 PM
Last Post: Martinelli
  Python Webscraping with a Login Website warriordazza 0 2,620 Jun-07-2020, 07:04 AM
Last Post: warriordazza
  using webbot for website login fails loeten 2 6,438 Jan-03-2019, 07:31 AM
Last Post: loeten
  Login and access website mariolopes 7 9,275 Feb-07-2018, 09:47 AM
Last Post: mariolopes
  Using python requests module and BS4 to login on an Wordpress based website apollo 1 9,453 Feb-06-2018, 01:31 AM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020