[英]How to find the first empty row of a google spread sheet using python GSPREAD?
[英]How to read Data from Google spread sheet using Robot Framework
我想使用 Google 電子表格中的 Robot Framework 讀取數據。 例如,電子表格位置是:- https://www.swiggy.com/pop/listing
任何人都可以指導我編寫哪些 RF 步驟來讀取工作表數據並將其作為列表存儲在 RF 中。?
我寫的步驟:
${Excel_List}= Create List
Open Excel ${Excel_Path}
FOR ${i} IN RANGE 2 15
${data} Read Cell Data By Name External ids A${i}
Append To List ${Excel_List} ${data}
Log ${Excel_List}
謝謝你
您可以使用excelibrary嘗試以下兩行
這里,Sheet1 是工作表,1 是行#
${RowVal}= Get Row Values Sheet1 1
@{row_list} = Convert To List ${RowVal}
或者
您可以將 excel 文件轉換為 CSV,然后使用 CSVLibrary 和 CSVlibrary 中的以下關鍵字。
您可以安裝以下庫並使用將 cvs 轉換為列表或將 cvs 轉換為列表列表或將 csv 轉換為 dict 的關鍵字之一。
示例
在這里,下面的行創建了一個丟失的列表,而不是一個列表。
${list}= read csv as list test.csv
*** Settings ***
Library CSVLib
Library Collections
*** Test Cases ***
Test CSV
${singlelist}= Read CSV As Single List test.csv
log to console ${singlelist}
${list}= read csv as list test.csv
log to console ${list}
${dict}= read csv as dictionary test_dict.csv Animal Legs ,
log to console ${dict}
${value}= create list Legs Eyes
${dictWList}= read csv as dictionary test_dict1.csv Animal ${value} ,
log to console ${dictWList}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.