Which library to import in Python to read data from an Excel file, I want to store different xpaths in Excel file for automation testing using Selenium?
2 Answers
You may use XlsxWriter. It is a Python module for writing files in Excel. xlutils is also very useful collection of utilities for automating excel sheet operations.
1 Comment
Community
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
10 Comments
Yogesh
Actually like in java there is a file excelreader.java in apache POI like that , I want to read data from excel file for xpaths, so I am looking a file which can read data in python
Kidus
xlrd does that. Install it using pip install xlrd. Then you can import it in your projects and use it to read excel files like book = xlrd.open_workbook(file). From that you can access sheets, rows, and columns.Yogesh
@Kidus__ If you have an example of reading data in python and selenium can u please paste it here. Thanks in advance.
Kidus
You can Google for examples. But here's one on xlrd: blogs.harvard.edu/rprasad/2014/06/16/…
Yogesh
Thank you @Kidus for help. I will use this example blogs.harvard.edu/rprasad/2014/06/16/...
|