Hopefully a simple question here:
I want a basic scraping utility to save the first five search results to individual lines of a CSV file.
Is it possible to do this with !csvLine, or do I need !csvSaveArray?
This simple code almost works - it loads the CSV, identifies the target, and stores it:
csvReadArray | listfile.csv | MyCSVArray
storeAttribute | xpath=//*[@id=“__next”]/div/div[2]/div/div/div[2]/main/section/div[2]/article/div[2]/div/div/h3/a@href | !csvLine
csvSave | listfile
Only one problem: If I do additional instances of !csvLine it saves all the values on the same line (row).
So “link1” + “link2” + “link3” become become “link1,link2,link3”
I want them in separate rows (lines).
Unless there is a way to get !csvLine to save as seperate lines, it seems like what I need to do is use saveCsvArray to save each value as an individual array with subsequent line numbers.
Howeverrrrrr,… the command documentation for csvSaveArray is laughable (like two sentences, no example) and it references a Demo macro ( DemoCsvSaveArray) that literally does not exist.
Can someone please explain how to do this with either !csvLine or !csvSaveArray?
Thank you!