Reading from and Extracting to CSV in FF
Posted: Mon May 03, 2021 3:20 pm
VERSION BUILD=10101485
Win10
FF 88.0 (64-bit)
Good morning!
I've got a huge project I'm working on with the sales site I run, the first part of it is simple, I'm searching and plugging in data from a CSV, the part I'm having trouble with is extracting data in product pages to the CSV. All the examples and forum posts I have been able to find about extracting to a CSV are only saving to a CSV, I need to save to a CSV but also read from a CSV. Here is the script I have been testing with:
It doesn't necessarily have to be the same csv file if that is one of the problems. Also, what I am trying to extract is a table, I'm not trying to extract it as a table though because when I have tried that it doesn't paste any of the correct information into the CSV. The areas for price and quantity or text areas which I think is the reason its not grabbing the values in those fields. If there is a way around that please let me know.
When I run the script above I get the error:
RuntimeError: Column number 3 greater than total number of columns 2, line: 12
Which I suspect I'm getting because the macro is still paying attention to the datasource, but I'm not sure how to tell it to ignore that.
Thank you in advance!
Win10
FF 88.0 (64-bit)
Good morning!
I've got a huge project I'm working on with the sales site I run, the first part of it is simple, I'm searching and plugging in data from a CSV, the part I'm having trouble with is extracting data in product pages to the CSV. All the examples and forum posts I have been able to find about extracting to a CSV are only saving to a CSV, I need to save to a CSV but also read from a CSV. Here is the script I have been testing with:
Code: Select all
VERSION BUILD=10101485
SET !DATASOURCE C:\Users\forms\Desktop\extracttest.csv
SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}}
SET !TIMEOUT_STEP 100
URL GOTO=https://heraldpg.myprintdesk.net/DSF/Admin/MD/base.aspx#/products
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:aspnetForm ATTR=ID:orderId_IntegerTxt CONTENT={{!COL1}}
Wait seconds=.5
TAG POS=1 TYPE=SPAN ATTR=TXT:{{!COL2}}
TAG POS=2 TYPE=SPAN ATTR=TXT:Pricing
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:aspnetForm ATTR=ID:tbl_0_PriceCatalog_rngend_1 Extract=TXT
SET !EXTRACT {{!COL3}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:aspnetForm ATTR=ID:tbl_0_PriceCatalog_rngend_2 Extract=TXT
SET !EXTRACT {{!COL4}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:aspnetForm ATTR=ID:tbl_0_PriceCatalog_regularprice_1 Extract=TXT
SET !EXTRACT {{!COL10}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:aspnetForm ATTR=ID:tbl_0_PriceCatalog_regularprice_2 Extract=TXT
SET !EXTRACT {{!COL11}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:aspnetForm ATTR=ID:tbl_0_PriceCatalog_regularprice_3 Extract=TXT
SET !EXTRACT {{!COL12}}
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\forms\desktop FILE=extracttest.csv
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:aspnetForm ATTR=ID:ctl00_ctl00_C_M_ctl00_W_StartNavigationTemplateContainerID_ctl00_BtnSaveAndExit
When I run the script above I get the error:
RuntimeError: Column number 3 greater than total number of columns 2, line: 12
Which I suspect I'm getting because the macro is still paying attention to the datasource, but I'm not sure how to tell it to ignore that.
Thank you in advance!