2

I am using Selenium for web automation and Python as a language and I'm doing this on a Chrome browser.

I have this setup in Azure Databricks. I want to download an excel from the website and I do this by clicking the "Export to Excel" button. Now if I do the same in my local system it gets downloaded in my local machine's Download folder but can anybody help me to find where it will get downloaded now because it's being run through Azure Databricks notebook.

Is there a way where I can directly download that file to blob storage or any other specific storage? Thanks in advance.

Export to Excel button Export to Excel button

exportToExcel = driver.find_element_by_xpath('//*[@id="excelReport"]')
exportToExcel.click()
time.sleep(10)
CHEEKATLAPRADEEP
  • 12,191
  • 1
  • 19
  • 42
  • What happen when you click "Export to Excel" button in Azure Databricks notebook? Could you please help on understanding how you are this in notebooks? – CHEEKATLAPRADEEP Apr 30 '20 at 06:39
  • It is getting downloaded but I don't know where it is getting downloaded as it is getting downloaded on the runtime machine. – Karthick Kumar Apr 30 '20 at 07:48
  • Could you please share the gif file using "screentogif" software, to understand what you are trying? By providing the gif file helps us to provide the answer. – CHEEKATLAPRADEEP Apr 30 '20 at 07:50
  • I'm worried that I will not be able to record a screentogif because this automation task is not running in my local system . It is running in some remote system and I want to access the file from that system . Or directly download the file to azure blob. The moment I click the button it downloads the file without any further popups or windows .. – Karthick Kumar Apr 30 '20 at 08:09
  • From local machine, you can upload the downloaded file to dbfs filesystem or copy it to blob storage account and access the storage account in notebooks. – CHEEKATLAPRADEEP Apr 30 '20 at 09:20

1 Answers1

0

These are the options available to upload the files to Azure Databricks File System DBFS.

Option 1: Use Databricks CLI to upload files from local machine to DBFS.

Steps for installing and configuring Databricks CLI

Once databricks cli installed, you can use the below command to Copy a file to DBFS

dbfs cp test.txt dbfs:/test.txt
# Or recursively
dbfs cp -r test-dir dbfs:/test-dir

Option 2: DBFS Explorer for Databricks

DBFS Explorer was created as a quick way to upload and download files to the Databricks filesystem (DBFS). This will work with both AWS and Azure instances of Databricks. You will need to create a bearer token in the web interface in order to connect.

The tool is quite basic, today you can: [ Upload, Download, Create Folders, Delete Files ]

Drag and Drop files from Windows Explorer/Finder

Option 3: You can upload data to any Azure Storage account such as [Azure Blob Storage, ADLS Gen1/Gen2 ] and you can mount a Blob storage container or a folder inside a container to Databricks File System (DBFS). The mount is a pointer to a Blob storage container, so the data is never synced locally.

Reference: Databricks - Azure Blob storage

CHEEKATLAPRADEEP
  • 12,191
  • 1
  • 19
  • 42