Suppose that you want to get the following data from an Excel:
Then, visit http://www.amazon.com, and search Apple on Amazon.
It's recommended to import the following JSON into AdsPower for further learning.
[
{
"type": "useExcel",
"config": {
"path": "C:\\Users\\snake\\Desktop\\RPA.xlsx",
"variableList": [
"URL",
"keyword"
],
"remark": "Change to your excel file",
"variable": "excel_data"
}
},
{
"type": "extractKey",
"config": {
"content": "excel_data",
"key": "0",
"variable": "line1",
"remark": "Extract the data in row 1"
}
},
{
"type": "extractKey",
"config": {
"content": "line1",
"key": "URL",
"variable": "url1",
"remark": "Extract data in column URL"
}
},
{
"type": "extractKey",
"config": {
"content": "line1",
"key": "keyword",
"variable": "key_data",
"remark": "Extract data in column keyword"
}
},
{
"type": "saveData",
"config": {
"name": "test",
"template": "Excel的数据:\n${excel_data}\n\n第1行的数据:\n${line1}\n\n第1行URL的数据:\n${url1}\n\n第1行keyword列的数据:\n${keyword}",
"remark": ""
}
},
{
"type": "newPage",
"config": {}
},
{
"type": "gotoUrl",
"config": {
"url": "${url1}",
"timeout": 30000,
"remark": "Use the URL data in line 1 to "
}
},
{
"type": "waitTime",
"config": {
"timeoutType": "randomInterval",
"timeout": 30000,
"timeoutMin": 5414,
"timeoutMax": 5555,
"remark": ""
}
},
{
"type": "inputContent",
"config": {
"selector": "#twotabsearchtextbox",
"serialType": "fixedValue",
"selectorType": "selector",
"element": "",
"serial": 1,
"serialMin": 1,
"serialMax": 50,
"intervals": 300,
"content": "",
"isRandom": "1",
"randomContent": "${keyword1}",
"remark": ""
}
},
{
"type": "screenshotPage",
"config": {
"name": "",
"path": "",
"quality": 50,
"format": "png",
"fullPage": "0",
"remark": ""
}
}
]
1. Create an Excel file as shown below, fill in the content, and save it.

2. Use the feature Import Data from Excel and upload the Excel file Save it into the variable "excel_data" to save the Excel data into the variable as arrays.
[{"URL":"https://www.amazon.com","keyword":"apple"},
{"URL":"https://www.ebay.com","keyword":"watch"},
{"URL":"https://www.etsy.com","keyword":"gundam"}]

3. Use Extract Field to extract your desired data from the variable "excel_data", and save it into the variable "line 1".
As we mentioned, the first element has an index of 0, so enter 0 as the Extract key.

The extracted data will be {"URL": "
https://www.amazon.com
", "keyword": "apple"}
, which is not yet available.
4. Use Extract Field to extract data from the variable "line 1", and enter "URL" as the Extract key.


Ditto, extract the keyword.

Now you have got the data you need.
Summary of ideas:
