I have a list of several hundred URL's, within one password protected account, and having the following format:
https://somesite.com/somescript.php?nameA
https://somesite.com/somescript.php?nameB
https://somesite.com/somescript.php?nameC
...
For each of those URL's, I would like to extract a string value from the corresponding webpage with such value always located between a specific prefix-string and a postfix-string, and creating a local CSV file with the data extracted from each URL:
nameA,valueA
nameB,valueB
nameC,valueC
...
Is there any simple way or script for doing this in Mac OS X?
I already tried the iMacros plugin for Firefox, but it seems it doesn't work, at least on Mac OS X. Maybe Automator, but I can't figure out how to do it...
valueA
from? Is it also in the URL and did you forgot to mention it? Please note that this should be relatively to do with a text editor and a regular expression search & replace. I don't know about a browser plugin capable of doing this though. I suppose you have these URLs in a list that you can copy paste to a text editor? Or are they really separate and not copyable? Because then writing an userscript with GreaseMonkey might be necessary, or well, a macro plugin.valueA
is not on the URL, it's on the content page that URL leads to. Yes I have a list of the URLs and/or names, that's no issue, and only the last parameter (name) changes. A userscript in GreaseMonkey might be a good idea (thanks!), though I'm not familiar with that. Right now, I was considering a bash script usingcURL
[curl.haxx.se/] to extract content page andsed
to parse the required values from the content. Main issues are handling web login through HTTPS and also all the regular expression madness.